I'm learning Javascript, and had this question. Here's some sample code:
var xq = false;
var fooyy = function ttt() {
var xq = false;
baryy = function() {
var xq = true;
console.log(xq);
console.log(ttt);
console.log(fooyy);
console.log(ttt.xq);
console.log(fooyy.xq);
console.log(window.xq);
}();
};
fooyy();
console.log(xq);
console.log(fooyy.xq);
Looking at the output, my question is, so does it mean that from an inner nested function, properties and variables of outer functions can't be accessed (both in the cases of having the same name and otherwise)? Or if they can, could you explain how and why? (I see that the local and global variables are accessible) Thanks!