Hey. If I create a function
function qwe() { var x=10; console.log(x); } qwe(); how can you get the variable x ? When the function fulfills (if you set a breakpoint), you can get it - write x in the console; However, if I write window.x; - will be already undefined , although the record x; and window.x; mean the same thing.
What is the execution context? Write, please, in your own words - as you understand. How does the execution context relate to scope? are they different things or not?
return xat the end of the function. - Nofate ♦xwithout the avar keyword, that is, simply:x = 10;, thenxwill be in the global scope. - Don2Quixote