Yesterday's puzzle was about creating the menu for the Elf Coffee Shop.
But now, the pretentious elves want an app where they can order their drink and it would be delivered to their place. And they want it TODAY!
We already created the menu so the only thing missing is a REST API to get the drinks.
For the moment... our job is to populate the API with the correct data, so it can be consumed by the app.
In this coding challenge we have to return an array of every item on the menu, with some additional data:
- Complete name, consisting of flavor + drink
- A "slugified" version of the name
The "slugified" version of the name will be probably useful later, when we will build the page for each single item.
In this case we will need to write two function:
Fortunately, a hint is provided in the case of accents because I couldn't remember how to filter them. Searching the internet I also found a different way of filtering the various characters using a dictionary. But I did not use this approach.
Here is my solution