var MyObject = function( arg ) {
this.value = arg;
};
MyObject.prototype.getValue = function() {
return this.value;
};
// Standard way of instantiating an object
var object1 = new MyObject( 'foo' );
// Creating new object based on another without using new operator
var object2 = {};
object2.__proto__ = object1.__proto__
object1.constructor.call( object2, 'bar' );
console.log( object1 );
console.log( object2 );
那么,如果没有__proto__属性,我该怎么做呢?