In Javascript, when is a new scope created? (with a new function and in a "with" statement) Are the

Posted by Jian Lin on Stack Overflow See other posts from Stack Overflow or by Jian Lin
Published on 2010-04-28T15:26:12Z Indexed on 2010/04/28 15:43 UTC
Read the original article Hit count: 140

Filed under:
|
|
|

In Javascript, when is a new scope created? The 2 situations I know of are:

  1. with a new function
  2. 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.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about scope