Wednesday, June 9, 2010

Scope In JavaScript

... is a little crazy. It's not a normal kind of scope by any means, though once you think about it, it's not too hard to understand. All you really have to remember is JavaScript uses function scope, not block scope, and anything not specifically declared in a function is technically in the global scope. That can be confusing to wrap your head around, but here are some examples to help out.