function(thisOtherNumber){
return numberToAdd + theOtherNumber;
}
That function remembers variables numberToAdd
that were around when the function was declared.
- Avoid variable hoisting from within blocks
- Protect against polluting the global environment
- Simultaneously allow public access to methods....
Emulate the concept of classes so we can include public and private methods & variables inside a single object
- thus shielding particular parts from the global scope.