Need clarification on Question 14.
The answer mentions the base object has no prototype, yet can still go down the prototype chain to find methods/properties. Doesn't the existence of the __proto__ object mean that this base object has a prototype?
+1
Should be interpreted as null or undefined instead of the basic object
The base object is the object created by the user, or an object that is created using the
newkeyword.
Agreed that the explanation has some problems. The above sentence sounds like the plain object, but in fact, I think the author means Object.prototype.
> Object.getPrototypeOf({})
{}
> Object.getPrototypeOf(Object.prototype)
null
Well, I am happy to get stuck on this while learning too. the answer definitely needs to be reviewed. anyway good learning, I won't hold it against myself not getting this question -:)
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain https://stackoverflow.com/questions/801032/why-is-null-an-object-and-whats-the-difference-between-null-and-undefined
It seems only null does not have a prototype, yet null is kind of a special case in itself.