Data update
This commit is contained in:
parent
35bcdeebf8
commit
74c69a0df6
2427 changed files with 31826 additions and 3468 deletions
|
|
@ -1,3 +0,0 @@
|
|||
function Animal() {
|
||||
// ...
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
function Dog() {
|
||||
// ...
|
||||
}
|
||||
Dog.prototype = new Animal();
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
function Cat() {
|
||||
// ...
|
||||
}
|
||||
Cat.prototype = new Animal();
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
function Collie() {
|
||||
// ...
|
||||
}
|
||||
Collie.prototype = new Dog();
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
function Lab() {
|
||||
// ...
|
||||
}
|
||||
Lab.prototype = new Dog();
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
Animal.prototype.speak = function() {print("an animal makes a sound")};
|
||||
|
||||
var lab = new Lab();
|
||||
lab.speak(); // shows "an animal makes a sound"
|
||||
28
Task/Inheritance-Single/JavaScript/inheritance-single.js
Normal file
28
Task/Inheritance-Single/JavaScript/inheritance-single.js
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
function Animal() {
|
||||
// ...
|
||||
}
|
||||
|
||||
function Dog() {
|
||||
// ...
|
||||
}
|
||||
Dog.prototype = new Animal();
|
||||
|
||||
function Cat() {
|
||||
// ...
|
||||
}
|
||||
Cat.prototype = new Animal();
|
||||
|
||||
function Collie() {
|
||||
// ...
|
||||
}
|
||||
Collie.prototype = new Dog();
|
||||
|
||||
function Lab() {
|
||||
// ...
|
||||
}
|
||||
Lab.prototype = new Dog();
|
||||
|
||||
Animal.prototype.speak = function() {print("an animal makes a sound")};
|
||||
|
||||
var lab = new Lab();
|
||||
lab.speak(); // shows "an animal makes a sound"
|
||||
Loading…
Add table
Add a link
Reference in a new issue