Open KhushalGupta305 opened 6 years ago
Explanation:-
In the outer function, both this and self refer to myObject and therefore both can properly reference and access foo.
In the inner function, though, this no longer refers to myObject. As a result, this.foo is undefined in the inner function, whereas the reference to the local variable self remains in scope and is accessible there.
Thanks for the idea. I think the book deserves the whole chapter about managing this
. I will work out 7-10 questions about it, so that everyone can go from one to another gradually.
Sure thing. Can I also add some more good questions to this Repo ?
Lastly, Can you please merge this PR ?
Thanks.
No, this one is not yet good enough to be merged, I will need to change it a bit.
Added new javascript question .