Created
December 1, 2018 22:16
-
-
Save manekinekko/d0f63644778519950c9f0e0339ee2752 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Jedi(name) { | |
this.name = name; | |
} | |
Jedi.prototype.toString = function () { | |
return 'I am ' + this.name; | |
}; | |
const luke = new Jedi('luke'); | |
console.log(luke.toString()); //=> 'I am luke' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment