Skip to content

Instantly share code, notes, and snippets.

@tored
Last active October 11, 2015 13:48
Show Gist options
  • Save tored/3868202 to your computer and use it in GitHub Desktop.
Save tored/3868202 to your computer and use it in GitHub Desktop.
beget: return a new object with o as a prototype
function beget(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