Skip to content

Commit c72cca8

Browse files
committed
minor fixes
1 parent 8812070 commit c72cca8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

1-js/09-classes/02-class-inheritance/article.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Animal {
1616
this.name = name;
1717
}
1818
run(speed) {
19-
this.speed += speed;
19+
this.speed = speed;
2020
alert(`${this.name} runs with speed ${this.speed}.`);
2121
}
2222
stop() {
@@ -124,7 +124,7 @@ class Animal {
124124
}
125125
126126
run(speed) {
127-
this.speed += speed;
127+
this.speed = speed;
128128
alert(`${this.name} runs with speed ${this.speed}.`);
129129
}
130130

0 commit comments

Comments
 (0)