Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Thom Benjamin
Thom Benjamin
10,494 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 48,850 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,494 Points

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