Classes 02: Classy dog


  1. Use a factory function to create a class of dogs that have a _name, an _age and that can bark. The bark() method should display the string 'Woof!'.
  2. Create a dog toby named 'Toby' and aged 2.
  3. Create a dog fox named 'Fox' and aged 4.
  4. Display the names of the dogs by using a getter method.






Join the waiting list to see the solution