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

is Object.create(null) has prototype? #33547

Open
pengzhijian opened this issue May 11, 2024 · 2 comments
Open

is Object.create(null) has prototype? #33547

pengzhijian opened this issue May 11, 2024 · 2 comments
Labels
Content:JS JavaScript docs good first issue A good issue for newcomers to get started with.

Comments

@pengzhijian
Copy link

MDN URL

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain

What specific section or headline is this issue about?

No response

What information was incorrect, unhelpful, or incomplete?

image
image

What did you expect to see?

this article say each object has an internal link to another object called its prototype.But other say Also allows the creation of objects without a prototype, using Object.create(null).I want know which is right.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

@pengzhijian pengzhijian added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label May 11, 2024
@github-actions github-actions bot added the Content:JS JavaScript docs label May 11, 2024
@xBZZZZ
Copy link
Contributor

xBZZZZ commented May 11, 2024

I think these mean same thing:

  • object has no prototype
  • object's prototype is null

@Josh-Cena
Copy link
Member

We should remove the mention of Object.create(null), as literally every other object creation method allows null prototypes here. I also think "without a prototype" is technically wrong but I think few people go into that level of detail as "null prototype" and "no prototype" are generally the same thing.

@Josh-Cena Josh-Cena added good first issue A good issue for newcomers to get started with. and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:JS JavaScript docs good first issue A good issue for newcomers to get started with.
Projects
None yet
Development

No branches or pull requests

3 participants