Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Object.create - The Good Parts
//The method creates a new object that uses an old object as its prototype.
if (typeof Object.create !== 'function') {
Object.create = function (o) {
var F = function () {};
F.prototype = o;
return new F();
};
}
var another_stooge = Object.create(stooge);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment