On Sun, Jan 17, 2016 at 6:37 PM, Ian Kelly <ian.g.ke...@gmail.com> wrote: > Technically it defaults to non local. The var statement allocates a > variable within the current scope. Otherwise it searches up the chain of > parent scopes for a matching variable...
This far, it's exactly the same as C. > ... terminating at the global scope. This is the bit that gets ridiculous. Undeclared variables in C are compile-time errors. Undeclared variables in JS are implicit globals. This is stupid. Oh, plus the fact that you can have "var x;" anywhere but it always applies to the whole function. But most of the time, that won't bite you. ChrisA -- https://mail.python.org/mailman/listinfo/python-list