Last active
August 9, 2023 12:37
-
-
Save scr2em/f1feeca998754f61e596a63cc3a6ff22 to your computer and use it in GitHub Desktop.
JS Lab 3 - ASAT 2023
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log(a); // ? | |
var a = 5; | |
// --------------------------------------- | |
console.log(typeof c); // ? | |
var c = 'hoist me'; | |
// --------------------------------------- | |
console.log(d); // ? | |
function foo() { | |
var d = 10; | |
console.log(d); // ? | |
} | |
// --------------------------------------- | |
console.log(e); // ? | |
var e = 5; | |
function e() {} | |
// --------------------------------------- | |
function hoistTest() { | |
console.log(g); // ? | |
var g = 'inner variable'; | |
} | |
hoistTest(); | |
// --------------------------------------- | |
function outer() { | |
function inner() { | |
console.log(l); // ? | |
} | |
var l = 'outer var'; | |
inner(); | |
} | |
outer(); | |
// --------------------------------------- | |
function foo() { | |
function bar() { | |
return 3; | |
} | |
return bar(); | |
function bar() { | |
return 8; | |
} | |
} | |
console.log(foo()); // ? | |
// --------------------------------------- | |
function parent() { | |
var hoisted = "I'm a variable"; | |
function hoisted() { | |
return "I'm a function"; | |
} | |
return hoisted(); | |
} | |
console.log(parent()); // ? | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment