Skip to content

Commit c7e59e7

Browse files
committed
extra js file
1 parent 9a08cd9 commit c7e59e7

1 file changed

Lines changed: 9 additions & 18 deletions

File tree

extra.js

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,44 +1050,35 @@
10501050

10511051

10521052

1053-
class Rabbit {
1053+
1054+
1055+
class Animal {
10541056
alive = true;
1055-
name = "rabbit"
10561057

10571058
eat() {
10581059
console.log(`This ${this.name} is eating`);
10591060
}
10601061
sleep() {
10611062
console.log(`This ${this.name} is sleeping`);
10621063
}
1064+
}
1065+
class Rabbit extends Animal {
1066+
name = "rabbit"
1067+
10631068
run() {
10641069
console.log(`This ${this.name} is running`);
10651070
}
10661071
}
1067-
class Fish {
1068-
alive = true;
1072+
class Fish extends Animal {
10691073
name = "fish"
10701074

1071-
eat() {
1072-
console.log(`This ${this.name} is eating`);
1073-
}
1074-
sleep() {
1075-
console.log(`This ${this.name} is sleeping`);
1076-
}
10771075
swim() {
10781076
console.log(`This ${this.name} is swimming`);
10791077
}
10801078
}
1081-
class Hawk {
1082-
alive = true;
1079+
class Hawk extends Animal {
10831080
name = "hawk"
10841081

1085-
eat() {
1086-
console.log(`This ${this.name} is eating`);
1087-
}
1088-
sleep() {
1089-
console.log(`This ${this.name} is sleeping`);
1090-
}
10911082
fly() {
10921083
console.log(`This ${this.name} is flying`);
10931084
}

0 commit comments

Comments
 (0)