Echo JS 0.11.0

<~>
venkman 4712 days ago. link 1 point
With all due respect, while the article tries to be thorough and that is good, some of the explanations are confusing and even misleading.

As an example, the author says this (about halfway through):

> This means that the scope of a function is always the context in which it executes, not the context in which it was defined.

Which, clearly, is not only wrong but, if true, would make for closures (explained further down) to simply not work. Because, well, that's exactly how closures work, by accessing the context in which the function was defined.

Where is the problem? The problem lies in the confusion between the *thisBinding* reference and the *context*, which the author takes to be the same but in fact are not.

Replies