Skip to content

Instantly share code, notes, and snippets.

@GengGao
Created July 17, 2013 21:30
Show Gist options
  • Save GengGao/6024684 to your computer and use it in GitHub Desktop.
Save GengGao/6024684 to your computer and use it in GitHub Desktop.
Douglas Crockford's Object.create method
if (typeof Object.create !== 'function') {
Object.create = function (o) {
function F() {
}
F.prototype = o;
return new F();
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment