I got to the point where I'm trying to fill my javascript knowledge with some of the more advanced concepts.
I think I really understand how the scope works. Where objects are inherited from the prototype and then the global area, while functions offer a more traditional block area within themselves.
I have a problem with understanding:
function a(){
console.log(this.z);
}
a.z = 12;
a();
I expected to repeat 12, but of course it is not. Where exactly is z stored? What does "this" mean in the example?
source
share