diff --git a/Base/home/anon/js/simple-scopes.js b/Base/home/anon/js/simple-scopes.js index dcea148c25..8580a8c770 100644 --- a/Base/home/anon/js/simple-scopes.js +++ b/Base/home/anon/js/simple-scopes.js @@ -1,9 +1,11 @@ + //I should return `undefined` because y is bound to the inner-most enclosing function, i.e the nested one (bar()), therefore, it's undefined in the scope of foo() function foo() { function bar() { var y = 6; } - bar() + bar(); return y; } -foo(); //I should return `undefined` because y is bound to the inner-most enclosing function, i.e the nested one (bar()), therefore, it's undefined in the scope of foo() + +print(foo());