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

Liz Lam @grepliz

About: I love open source, coffee and tinkering.

Location:
Oakland
Joined:
Jan 7, 2019

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

Publish Date: Aug 21 '20
13 0

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.

Comments 0 total

    Add comment