lydiahallie / javascript-questions

A long list of (advanced) JavaScript questions, and their explanations :sparkles:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question 14: All objects have prototypes

stuymedova opened this issue · 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.

`const noPrototype = Object.create(null);

console.log(noPrototype.toString());

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