15.2.3.5 Object.create(O, Properties)

2010-07-04

object Object.create(O:object[, Properties:object]) throw TypeError

Create a new object and sets the prototype property to O. It copies the properties of Properties to the resulting object.

Code: (Meta Ecma)
Object.create = function(O,Properties){
if (Type(O) != 'Object' && Type(O) != 'Null') throw TypeError;
var obj = new Object;
obj.[[Prototype]] = O;
if (Properties !== undefined) Object.defineProperties(obj, Properties);
return obj;
}