Source: vehicle.js

  1. /**
  2. * A vehicle is a thing that goes places
  3. */
  4. export default class Vehicle {
  5. /**
  6. * Create a new vehicle
  7. * @param numWheels Number of wheels
  8. */
  9. constructor(numWheels) {
  10. this.numWheels = numWheels;
  11. }
  12. /**
  13. * Drive the vehicle
  14. * @returns {string}
  15. */
  16. drive() {
  17. return `Driving with all ${this.numWheels} wheels`;
  18. }
  19. }