ganqqwerty / 123-Essential-JavaScript-Interview-Questions

JavaScript interview Questions
BSD 3-Clause "New" or "Revised" License
5.01k stars 1.18k forks source link

Update Readme.md #56

Open KhushalGupta305 opened 6 years ago

KhushalGupta305 commented 6 years ago

Added new javascript question .

KhushalGupta305 commented 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.

ganqqwerty commented 6 years ago

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.

KhushalGupta305 commented 6 years ago

Sure thing. Can I also add some more good questions to this Repo ?

Lastly, Can you please merge this PR ?

Thanks.

ganqqwerty commented 6 years ago

No, this one is not yet good enough to be merged, I will need to change it a bit.