Skip to content

Instantly share code, notes, and snippets.

@kkoziarski
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkoziarski/9d0e6b85272d12e57693 to your computer and use it in GitHub Desktop.
Save kkoziarski/9d0e6b85272d12e57693 to your computer and use it in GitHub Desktop.
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