★ wanayoo — archive 1999 https://github.com/ganqqwerty/123-Essential-JavaScript-Interview-Questions/pull/56Nouvelle recherche | Portail wanayoo
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Readme.md #56

Open
wants to merge 1 commit into
base: master
from
Open

Conversation

@KhushalGupta305
Copy link

@KhushalGupta305 KhushalGupta305 commented Oct 1, 2018

Added new javascript question .

Added new javascript question .
Copy link
Owner

@ganqqwerty ganqqwerty left a comment

Can you add a bit of explanation?

@KhushalGupta305
Copy link
Author

@KhushalGupta305 KhushalGupta305 commented Oct 2, 2018

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
Copy link
Owner

@ganqqwerty ganqqwerty commented Oct 2, 2018

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
Copy link
Author

@KhushalGupta305 KhushalGupta305 commented Oct 2, 2018

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

Lastly, Can you please merge this PR ?

Thanks.

@ganqqwerty
Copy link
Owner

@ganqqwerty ganqqwerty commented Oct 2, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.