function one() { var oneVar = "_oneVar_"; return function two() { var twoVar = "_threeVar_";; return function three() { var threeVar = "_threeVar_"; return function four() { threeVar; twoVar; oneVar; } } } } // Run code in Chrome specifically to check [[Scopes]] // Other browser like Firefox does not show Scopes console.dir(one); console.dir(one()); console.dir(one()()); console.dir(one()()());
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)