When I run the following code
var ExtendedObject = function() {
this.standard = 5;
};
Object = ExtendedObject.bind(Object);
var p = new Object();
console.dir(p.standard);
, the output is
5
as expected.
If I instead instantiate the variable p as an object literal like this:
var ExtendedObject = function() {
this.standard = 5;
};
Object = ExtendedObject.bind(Object);
var p = {};
console.dir(p.standard);
The result is
undefined
I am trying to find a way to modify the constructor of Object such that I can add some standard content to all new objects being created.