Created
August 2, 2016 17:49
-
-
Save VictorMedeiros/b62630b0665fab55e943b8384a65aa7c 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 MyCat(name) { | |
this.catName = name; | |
} | |
MyCat.prototype.sayCatName = function() { | |
console.log(this === cat); // => true | |
return this.catName; | |
}; | |
var cat = new MyCat('Mew'); | |
cat.sayCatName(); // => 'Mew' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment