Closures Flashcards
1
Q
Closures:
What is it called when a function retains a reference to variable in its outer scope?
A
A closure
function myobject(){ var value; return { set: function(v) { value = v }; get: function { return value }; } }
Get and set are closures.