mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
Base: Move "js" and "little" HackStudio projects into ~/Source/
This commit is contained in:
11
Base/home/anon/Source/js/simple-scopes.js
Normal file
11
Base/home/anon/Source/js/simple-scopes.js
Normal file
@@ -0,0 +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();
|
||||
return y;
|
||||
}
|
||||
|
||||
console.log(foo());
|
||||
Reference in New Issue
Block a user