Jonas: Hey there, it's now time for the final
coding challenge in this course,
so that you can apply some of the new ES6 features
that you just learned in this section.
So in this challenge, what I want you to do
is to imagine that you're working
in a small town administration and that you're in charge
of two town elements, parks and streets.
And this is a very small town,
so we currently only have three parks and four streets,
but more parks or streets may be added in the future.
Also, all of the parks and streets
have to have a name and a build year.
Now, at an end-of-the-year meeting,
your boss wants a final report with the following data.
First, he wants to know the tree density
of each park in the town, and that's calculated
by dividing the total number of trees by the park area.
Second, the average age of each town's park
and that one is calumniated by adding up
all of the ages and dividing it by the number of parks.
The third data that your boss wants to know
is the name of the park that has more than 1,000 trees.
So your boss knows that there is one park like this
but he wants to know the name of that park.
Okay, and as of the streets, we want to know
the total and average length of the town's streets
and also a size classification of each of the streets,
and these should be classified into tiny,
small, normal, big, and huge.
And if the size is unknown,
that the default is simply normal.
And all this report data should be printed to the console
so that it looks a little bit
like this output that I have here.
So we have the average age of our parks,
and then in here, we also have the tree density
of our three parks, and finally
the park that has more than 1,000 trees.
And for the streets, we have the total
and average length and then the size classification
for all of the four streets, and that's it.
Now, in this challenge, I'm not gonna give you
detailed steps on how to solve it like I did before,
because I think that you're really ready
to do it on your own at this point.
And that being said, the goal of this challenge
is of course that you use some of the ES6 concepts
that we talked about just in this section.
Things like classes, subclasses, template strings,
default parameters, maps, arrow functions,
and destructuring, for example,
and of course, you don't need to build anything
super fancy here because all I want
with this challenge is for you to practice
some of the new ES6 features here in this challenge.
So, good luck with this one, and if you struggle
with anything, then you can just watch the next video
to see my personal solution to this challenge.
But first, please try to do it on your own.