Does all Object refers to same Prototype Object on top of prototype chain in javascript?

52 Views Asked by At

I run following code and it looks like ultimately all objects have same object prototype on top of prototype chain and then this prototype point to null as its own prototype. does it concludes that all the object refers to the same object prototype on top of prototype chain just like every objects in java inherits from Object Class?

const a = 10;
const b = {}
const c = new Object();

const fun = function () {return 'i am fun()';}

console.log(a.__proto__.__proto__ === b.__proto__); // true
console.log(b.__proto__ === c.__proto__); // true
console.log(fun.prototype.__proto__ === c.__proto__); // true
0

There are 0 best solutions below