J
Jorge
I've rewritten a short article explaining closures in JavaScript.
It's
at:
http://www.martinrinehart.com/articles/javascript-closures.html
A big Thank You to PointedEars and Jorge for helping me get closer to
the truth.
"Some authors said (and this was where I got confused) that the
closure has access to the variables of the outer function. This is
sort of true. Really it has access to the variable's names and values
at the moment the closure is created."
This isn't clear enough... a bit messy.
An inner function that survives keeps working **exactly*as*it*did**
before outer() returned. That's all. I'm not sure what do you mean
with "Really it has access to the variable's names and values at the
moment the closure is created" ? There's not any kind of 'memory
effect' nor nothing like that...