I've gotten to the point where I am trying to fill out my javascript knowledge with some of the more advaned concepts.
I think I a pretty much understand how scope works. Where objects inherit from a prototype and then global scope, while functions offer a more traditional block scope within themselves.
What I am have trouble understanding is this:
function a(){
console.log(this.z);
}
a.z = 12;
a(); //returns undefined :(
I was expecting to echo out 12, but of course, it doesn't. Where exactly is z being stored? what does "this" refer to in the example?