What MDN means is the prototype property of Object itself. You cannot overwrite Object.prototype . If you try to make Object.prototype undefined, this will not work:
Object.prototype = 1; console.log(Object.prototype);
If you try this in strict mode, you will get a TypeError when you try to assign a property that cannot be written:
'use strict'; Object.prototype = 1;
You can write your own properties of the object without changing what the reference to the object is, and they have separate attributes. For example, see This:
var descriptor = Object.getOwnPropertyDescriptor(Object.prototype, 'toString'); console.log(descriptor.writable); // true console.log(descriptor.enumerable); // false console.log(descriptor.configurable); // true
There is a separate internal [[Extensible]] property that prevents the creation of new object properties β this is false if you call Object.preventExtensions , Object.seal or Object.freeze .
Please note that it is not recommended to name Object.freeze for something like Object.prototype , since really strange things can happen:
Object.freeze(Object.prototype); var building = {}; building.name = 'Alcove Apartments'; building.constructor = 'Meriton Apartments Pty Ltd'; console.log(building.constructor);
As in the previous example, it will also throw a TypeError in strict mode.
Basically, even if it is a property of the object itself, it uses the attributes from the prototype chain to check whether it can assign the property. This was considered a mistake in the language by some people, but others consider this design behavior.