Skip to content

Instantly share code, notes, and snippets.

@nobuh
Created August 1, 2011 08:27
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 nobuh/1117794 to your computer and use it in GitHub Desktop.
Save nobuh/1117794 to your computer and use it in GitHub Desktop.
Create new child from an object.
if (typeof Object.create != 'function') {
Object.create = function (obj) {
var F = function () {};
F.prototype = obj;
return new F();
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment