-
Notifications
You must be signed in to change notification settings - Fork 33.5k
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
this & Object Prototypes - Chapter 3 : 'in' operator #1271
Comments
Actually, sorry... I see what you mean, the I think what I was thinking, but conflated ideas and didn't articulate well in that paragraph, is that there's no built-in way to get all the properties from the whole prototype chain (which is what both forms of If you wanted to get the any-property list (emulating the I should definitely clarify this paragraph in the second edition. |
But that's when you are using the in operator inside a for..in loop. However, when used alone, it checks for non-enumerable properties as well. The code below prints true :
|
Yes. Exactly what I meant to say 👍 |
There's a paragraph related to the in operator that goes like this :
Why do we need to capture only the enumerable properties. The in operator also checks for non-enumerable properties as well. So instead of using Object.keys(), shouldn't we use Object.getOwnPropertyNames() to build the utility?
The text was updated successfully, but these errors were encountered: