Skip to content

Instantly share code, notes, and snippets.

@defunkt
Created August 2, 2008 01:36
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 defunkt/3711 to your computer and use it in GitHub Desktop.
Save defunkt/3711 to your computer and use it in GitHub Desktop.
Object.prototype.delegated = function(props) {
var f = function() { }
f.prototype = this
var r = new f()
for (var p in props)
if (props.hasOwnProperty(p))
r[p] = props[p]
return r
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment