Last active
December 29, 2016 22:20
-
-
Save hugopeixoto/0695ea71a4e8833d530a640a1fffe561 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var Root = class { | |
constructor(name) { this.name = name; this.getName = this.getName.bind(this); } | |
getName() { return this.name; } | |
getNameOrig() { return this.name; } | |
}; | |
var Child = class extends Root { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var Root = function(name) { this.name = name; this.getName = this.getName.bind(this); } | |
Root.prototype.getName = function() { return this.name; }; | |
Root.prototype.getNameOrig = function() { return this.name; }; | |
var Child = function() { Root.apply(this, arguments); } | |
Child.prototype = Object.create(Root.prototype); | |
Child.__proto__ = Root; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment