Skip to content

Instantly share code, notes, and snippets.

@westonwatson
Created September 20, 2012 17:27
Show Gist options
  • Save westonwatson/3757211 to your computer and use it in GitHub Desktop.
Save westonwatson/3757211 to your computer and use it in GitHub Desktop.
Polyfill for Object.create();
if (!Object.create) {Object.create = function (o) {if (arguments.length > 1) {throw new Error('Object.create implementation only accepts the first parameter.');}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