In Javascript, when is a new scope created? (with a new function and in a "with" statement) Are the
- by Jian Lin
In Javascript, when is a new scope created? The 2 situations I know of are:
with a new function
in a "with" statement
as a note, any new block (in if-then-else, loops, or just beginning a block for no other reason) won't create a new scope.
Is there a third situation where a new scope is created besides the two situations above? Thanks.