Coding Challenge #4#
Your tasks#
- Re-create Challenge #3, but this time using ES6 classes: create an 'EVCl' child class of the 'CarCl' class
- Make the 'charge' property private
- Implement the ability to chain the 'accelerate' and 'chargeBattery' methods of this class, and also update the 'brake' method in the 'CarCl' class. Then experiment with chaining!
Test data#
- Data car 1: 'Rivian' going at 120 km/h, with a charge of 23%
GOOD LUCK 😀
1 |
|