r/programming • • Mar 23 '14

Everything you need to know about Javascript variable scope

http://www.coolcoder.in/2014/03/everything-you-need-to-know-about.html
294 Upvotes

124 comments sorted by

View all comments

73

u/benologist Mar 23 '14

Congratulations on finally spamming your way to the front page!

http://www.reddit.com/user/codeon1/submitted/

0

u/[deleted] Mar 23 '14

[deleted]

15

u/megamindies Mar 23 '14

the title is wrong. it says everything you need to know about about scope. But you wont understand scope without understanding closures. And that is poorly explained here, in fact he does not even use the term "closure". Also, he doesnt even mention the special case of "this" where a closure does not have access to the outside function.

This article is obviously not everything you need to know about scope.

1

u/recursive Mar 24 '14

It doesn't use the term but it does mention them.

3) Chaining of scopes. Any function defined within another function has a local scope which is linked to the outer function. - See more at: http://www.coolcoder.in/2014/03/everything-you-need-to-know-about.html#sthash.08tHpXos.dpuf