mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 20:24:57 +00:00
Base: Move "js" and "little" HackStudio projects into ~/Source/
This commit is contained in:
parent
bc615572a9
commit
db450dbc44
28 changed files with 1 additions and 1 deletions
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());
|
Loading…
Add table
Add a link
Reference in a new issue