1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:54:57 +00:00
serenity/Base/home/anon/Source/js/simple-scopes.js

11 lines
276 B
JavaScript

//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();
return y;
}
console.log(foo());