Last active
August 29, 2015 14:02
-
-
Save tarzak/9ce3bb224cedb79ce45e to your computer and use it in GitHub Desktop.
job exercise
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 Animal(name) { | |
| this.name = name; | |
| this.getName = function() { | |
| console.log(this.name); | |
| } | |
| } | |
| function Cat(name) { | |
| this.name = name; | |
| this.meow = function() { | |
| console.log("Cat " + this.name + " is saying meow!"); | |
| } | |
| } | |
| Cat.prototype = new Animal(); | |
| var lilCat = new Cat("Коша"); | |
| lilCat.getName(); | |
| lilCat.meow(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment