Skip to content

Instantly share code, notes, and snippets.

@jaredatron
Created April 24, 2010 22:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jaredatron/377983 to your computer and use it in GitHub Desktop.
Save jaredatron/377983 to your computer and use it in GitHub Desktop.
;(function() {
function create(object){
if (object){
create.prototype = object;
return new create;
}
}
Object.create || (Object.create = create);
})();
@aaronblohowiak
Copy link

in the book, he checks if create is already defined or not ;)

@aaronblohowiak
Copy link

oh wait. this is neat ;)

@jaredatron
Copy link
Author

hurray for slightly more performant code =D

@aaronblohowiak
Copy link

I'd love to see the benchmark!!

@jaredatron
Copy link
Author

good luck!

@aaronblohowiak
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment