lydiahallie / javascript-questions

A long list of (advanced) JavaScript questions, and their explanations :sparkles:
MIT License
62.99k stars 8.94k forks source link

Q14. All object have prototypes. (wrong explanation) #797

Open Ali7040 opened 2 months ago

Ali7040 commented 2 months ago

The base object is the object created by the user, or an object that is created using the new keyword. is incorrect.

The correct explanation is that Object.prototype is the base object in JavaScript. All objects, except for Object.prototype itself, have prototypes. Objects created by the user or with the new keyword inherit from a prototype, typically Object.prototype or a constructor's prototype.

Please correct me if I am wrong.

FrOz3nFir3 commented 2 months ago

exactly you are spot on, I hope the author review this and edits it, otherwise we have to raise the pr.

iNikAnn commented 1 month ago

The term "base object" is not found in the JavaScript language specification, so I think it is inappropriate to use it.

Am I wrong?

Ali7040 commented 1 month ago

@iNikAnn You're right, it's not a term found in the JavaScript specification, it is a programming term that people often use to refer to objects that serve as prototypes or foundations from which other objects inherit properties or methods.