Skip to content

Commit 965b777

Browse files
mouredev#28-javascript
1 parent 2116191 commit 965b777

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Roadmap/28 - SOLID LSP/javascript/caterinarodriguezdev.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,24 @@
1515
*/
1616

1717
class Ball {
18+
bounce() {
19+
console.log(`The ball bounce!!!`);
20+
}
21+
}
22+
23+
class BowlingBall extends Ball {
24+
bounce() {
25+
throw new Error(`Bowling ball can't bounce!!!`)
26+
}
27+
}
28+
29+
class BallLSP {
1830
throw() {
1931
console.log(`Throw the ball`);
2032
}
2133
}
2234

23-
class BowlingBall extends Ball {
35+
class BowlingBallLSP extends Ball {
2436
throw() {
2537
console.log(`Throw the ball toward pins`);
2638
}

0 commit comments

Comments
 (0)