This coding challenge is a part of The Complete JavaScript Course: Build a Real-World Project on Udemy.
The main purpose of this simple coding challenge is to use the new features of ES6 / ES2015 like:
- classes
- subclasses
- template strings
- default parameters
- maps
- arrow functions
- destructuring
- and more
###Instruction of the challenge:
Suppose that you're working in a small town administration, and you're in charge of two town elements:
- Parks
- Streets
It's a very small town, so right now there are only 3 parks and 4 streets. All parks and streets have a name and a build year.
At an end-of-year meeting, your boss wants a final report with the following:
- Tree density of each park in the town (formula: number of trees/park area)
- Average age of each town's park (formula: sum of all ages/number of parks)
- The name of the park that has more than 1000 trees
- Total and average length of the town's streets
- Size classification of all streets: tiny/small/normal/big/huge. If the size is unknown, the default is normal
All the report data should be printed to the console.
###Note: In the script.js file, you will see my solution and the solution of the instructor (commented at the end of the file).