This is how you would implement it using promises
6 Reasons Why JavaScript’s Async/Await Blows Promises Away (Tutorial)
Mostafa Gaafar

Except you forgot to return the result of getJSON, a common promise-using oversight that’s harder with async/await.

Like what you read? Give Dan Finlay a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.