javascript-questions icon indicating copy to clipboard operation
javascript-questions copied to clipboard

Question 14: All objects have prototypes

Open stuymedova opened this issue 4 years ago • 1 comments

I've researched some information on this, the MDN states:

Every object in JavaScript has a built-in property, which is called its prototype. The prototype is itself an object, so the prototype will have its own prototype, making what's called a prototype chain. The chain ends when we reach a prototype that has null for its own prototype.

My understanding is that every object has a prototype and the last one in the chain has null for its value. I couldn't find any information on the "base object". I'd suggest that perhaps the answer may be incorrect.

stuymedova avatar Nov 04 '22 10:11 stuymedova

`const noPrototype = Object.create(null);

console.log(noPrototype.toString());

// throws an error noPrototype.toString is not a function `

black1277 avatar Nov 26 '22 07:11 black1277