Skip to content

Instantly share code, notes, and snippets.

@mahigupta
Created August 9, 2019 20:40
Show Gist options
  • Save mahigupta/613f9b76cba5b7381668b63eb4928fff to your computer and use it in GitHub Desktop.
Save mahigupta/613f9b76cba5b7381668b63eb4928fff to your computer and use it in GitHub Desktop.
Javascript Object create function
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