Skip to content

Instantly share code, notes, and snippets.

@Lodo4ka
Created September 17, 2018 08:12
Show Gist options
  • Save Lodo4ka/6c9cfe0d77188b04ec3dee11d92f5ba9 to your computer and use it in GitHub Desktop.
Save Lodo4ka/6c9cfe0d77188b04ec3dee11d92f5ba9 to your computer and use it in GitHub Desktop.
function inherit(child, parent) {
var Temp = function () {};
Temp.prototype = parent.prototype;
child.prototype = new Temp();
}
inherit(F2, F);
function inherit(child, parent) {
child.prototype = Object.create(parent.prototype);
}
function inherit(child, parent) {
child.prototype = Object.create(parent.prototype);
child.parent = parent;
}
F2.parent.prototype.setName.call(this, name);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment