JavaScript

Thom Benjamin
Thom Benjamin
10,492 Points

How to practise Promises, API fetches and async awaits

I've completed the entire front dev track, and everything is perfectly clear to me now, except the three mentioned. I think I understand Promised and the fetch method and I can follow them when I see it written out, but I need a lot more practise. Async awaits seem to make things more complicated instead of easier to me.

Does someone know good API's or projects to try and work out as a way of practising these concepts?

Thanks!

1 Answer

Clayton Perszyk
MOD
Clayton Perszyk
Treehouse Moderator 46,142 Points

Maybe build an app that gets all songs for an artist on spotify:

  1. input for entering artist search
  2. list out results

Implement three times with promises, fetch, and async/await, and reflect on the differences.

Additional Resources:

https://dev.to/shoupn/javascript-fetch-api-and-using-asyncawait-47mp

https://itnext.io/javascripts-async-await-versus-promise-the-great-debate-6308cb2e10b3

https://eloquentjavascript.net/11_async.html

Thom Benjamin
Thom Benjamin
10,492 Points

Wow, there's an API for Spotify? Awesome, thanks!