This source code (Javascript ES6) implements a class designed to analyse people’s hobbies based upon their age.
The data is stored in a database and is retrieved by the class using the Database.GetPeople
method.
Each person’s name, age and hobbies are stored in an instance of the Person class.
The FindPeople method has two purposes:
- Find the average age of all people who play ball sports. In this exercise “ball sports” is taken to include football and rugby.