Glossary: Software Design Patterns in JavaScript
Closure
Also written: closures
A function that remembers the variables from where it was created. percentOff(10) returns a discount function that still remembers pct is 10.
Glossary: Software Design Patterns in JavaScript
Also written: closures
A function that remembers the variables from where it was created. percentOff(10) returns a discount function that still remembers pct is 10.