Comments on: Of Function Scope and Lexical Scoping http://pierrespring.com/2010/05/11/function-scope-and-lexical-scoping/ geek, punk, pussy … Sat, 05 Oct 2013 14:25:34 +0000 hourly 1 http://wordpress.org/?v=3.8.12 By: Michael http://pierrespring.com/2010/05/11/function-scope-and-lexical-scoping/comment-page-1/#comment-59759 Sat, 05 Oct 2013 14:25:34 +0000 http://pierrespring.com/?p=48#comment-59759 Your explanation worked perfectly for me.
Thx!!

]]>
By: Eden http://pierrespring.com/2010/05/11/function-scope-and-lexical-scoping/comment-page-1/#comment-47718 Sun, 05 May 2013 13:21:40 +0000 http://pierrespring.com/?p=48#comment-47718 Let’s do a little thought experiment:

Imagine a language (it doesn’t matter whether or not such a language exists) that provides for the scope of an inner function to encompass the scope of its outer function BUT, by whatever means, DOES NOT provide for that inner function still to have access to the outer scope once the outer function has returned.

In that case, you would have Lexical Scoping but not Closure.

For this reason, I contend that, whereas “Lexical Scoping” is synonymous with “Static Scoping”, neither term is synonymous with “Closure”, however, Lexical/Static Scoping is a PREREQUISITE for Closure.

]]>
By: Jakob http://pierrespring.com/2010/05/11/function-scope-and-lexical-scoping/comment-page-1/#comment-36403 Thu, 20 Dec 2012 08:53:04 +0000 http://pierrespring.com/?p=48#comment-36403 Thank you for this article, it helped me a lot!

]]>
By: Daniel http://pierrespring.com/2010/05/11/function-scope-and-lexical-scoping/comment-page-1/#comment-29307 Thu, 16 Aug 2012 13:29:32 +0000 http://pierrespring.com/?p=48#comment-29307 JavaScript doesn’t have block scope, the only way to declare new scope is with function or the `let` keyword. In your `for` loop example, you re-declare the var i which is the same as the one declared above it.

]]>
By: Patrick Keenan http://pierrespring.com/2010/05/11/function-scope-and-lexical-scoping/comment-page-1/#comment-15 Mon, 17 May 2010 11:34:03 +0000 http://pierrespring.com/?p=48#comment-15 That’s super cool. It’s cool to try these examples just in the chrome debugger. I guess scoping is how jQuery does all its chaining stuff. I always wondered how that worked. Despite actionscript’s similarities I don’t think it has this type of scoping built in(at least in AS3). Thanks for the run down.

]]>
By: Yoan http://pierrespring.com/2010/05/11/function-scope-and-lexical-scoping/comment-page-1/#comment-10 Tue, 11 May 2010 17:50:09 +0000 http://pierrespring.com/?p=48#comment-10 Played with __parent__ already? http://liip.to/__parent__

]]>