-
-
Save nebiros/ecec33aac29d28641217 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
function Hi(msg) { | |
this.msg = msg; | |
} | |
Hi.prototype = { | |
constructor: Hi, | |
say: function (msg) { | |
return this.msg + " " + msg; | |
} | |
} | |
function MyHi() {} | |
MyHi.prototype = new Hi(); | |
MyHi.prototype.constructor = MyHi; | |
var hi = new MyHi(); | |
console.log(hi.say("hola")); // undefined hola |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment