Look at it this way: when we access the “foo” variable from within the “sayFoo” function of this code
(click the link for the JSFiddle, if you’re in an RSS reader) the runtime has to step out of the “sayFoo” function and find the “foo” variable declared in the “outerScope” function.
Now look at similar code accessing the `$` variable from jQuery, as well as a `bar` variable defined in the outermost, global scope:
… mystery, suddenly not so mysterious.
Post Footer automatically generated by Add Post Footer Plugin for wordpress.