Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Recommended alternative to mutable __proto__ from mozilla
Object.create2 = function(a, b) {
var res = Object.create(a);
for (var x in b) { if (b.hasOwnProperty(x)) res[x] = b[x]; }
return res;
var o = Object.create2(foo, { f:0, g:1, ... });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.