How to use the fetch API with and without async/await

grepliz

Liz Lam

Posted on August 21, 2020

How to use the fetch API with and without async/await

Sometimes the best way to explain something to someone is to just show them an example. This was the case when a couple of coworkers had some confusion around using async/await.

After verbally explaining, I opened up my web console and gave them a quick example. This seemed to clarify their understanding.

I will share the example here in case it's helpful to anyone else.

Fetch API example

SIDE NOTE: This also made me think about how just playing around in the web console is a great way to learn of JavaScript. It's also an easy way to share knowledge because anyone can just copy what you have into their own web console.

💖 💪 🙅 🚩
grepliz
Liz Lam

Posted on August 21, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related