Closed
Bug 1491327
Opened 7 years ago
Closed 7 years ago
I think, I found the logical error in the tutorial.
Categories
(Developer Documentation Graveyard :: Learning Area, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: romzeeed, Assigned: cmills)
References
()
Details
:: Developer Documentation Request
Request Type: Correction
Gecko Version: unspecified
Technical Contact:
:: Details
Hello.
In the first sentences of "A prototype-based language?" (https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Object_prototypes) I think I see the logical error.
1. "JavaScript is often described as a prototype-based language — each object has a prototype object, which acts as a template object that it inherits methods and properties from".
// So, EACH object has a prototype object.
2. "An object's prototype object may also have a prototype object, which it inherits methods and properties from, and so on".
// Object's prototype object may have a prototype object. It means that an object may not have a prototype object. But in a first sentence, it is stated that every object has a prototype object.
// So, not every object has a prototype object, I think. Technically, every object with an exception of the object, which stands on top of that hierarchy.
I am just learning JS, so I wonder: this is my misunderstanding or inaccuracy in the tutorial?
And by using "Object.create(null)" I can create an object without object-prototype.
| Assignee | ||
Comment 2•7 years ago
|
||
This is a really good point, thanks for reporting this! You are right — the wording was bad, as not all objects have a prototype. I've updated this now; does this work better for you?
Assignee: nobody → cmills
Flags: needinfo?(romzeeed)
(In reply to Chris Mills (Mozilla, MDN editor) [:cmills] from comment #2)
> This is a really good point, thanks for reporting this! You are right — the
> wording was bad, as not all objects have a prototype. I've updated this now;
> does this work better for you?
Thank, Chris!
Yes, now I'm happy.
Flags: needinfo?(romzeeed)
| Assignee | ||
Comment 4•7 years ago
|
||
Cool, glad you are happy! Closing.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•