Created
December 2, 2014 21:26
-
-
Save devdays/1292b74006ca6decfa33 to your computer and use it in GitHub Desktop.
Object JavaScript - prototype
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
Cat.prototype.changeName = function(name) { | |
this.name = name; | |
} | |
var firstCat = new Cat("cc"); | |
firstCat.changeName("bill"); | |
firstCat.talk() //will now send "bill says meeow!" to the console |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment