Hacker News new | ask | show | jobs
by robmcm 4596 days ago
The bit that helped most from the meteor post was this:

Well, the typical way that closures are implemented is that every function object has a link to a dictionary-style object representing its lexical scope. If both functions defined inside replaceThing actually used originalThing, it would be important that they both get the same object, even if originalThing gets assigned to over and over, so both functions share the same lexical environment.

1 comments

Good quote. That is certainly a simple way to manage things. It isn't the only way (nor the best IMHO), but it is the simplest.