Skip to content

Instantly share code, notes, and snippets.

@tarzak
Last active August 29, 2015 14:02
Show Gist options
  • Select an option

  • Save tarzak/9ce3bb224cedb79ce45e to your computer and use it in GitHub Desktop.

Select an option

Save tarzak/9ce3bb224cedb79ce45e to your computer and use it in GitHub Desktop.
job exercise
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