- Use vanilla JavaScript
- Use the API option to return the data using a JSON object
- Code it so every 5 seconds the columns get a new set of random numbers
- Make sure the new set of numbers that appear every 5 seconds haven’t appeared before
- There’s no need to make this section overly pretty, but make sure it’s responsive
This part was a bit tricky because the API is very slow, the response is very late at times, therefore, since there is a 5 seconds delay before a new request (setInterval), when the API sends a response, it ends up gathering all the requests in the queue.
To avoid this I have used an asynchronous function, and instead of asking the api for a random route, I previously chose a random number so that I can request a specific route.
-
Random facts:
- Numbers
- Trivia
- Year