Fetching Data from API for Dummies (JavaScript).

Subscribe to my newsletter and never miss my upcoming articles

Fetch API + for of + async/await

we would not be using Promise.all and Promises chaining

const urls = [
async function getDatafromAPI(){
  const dataInArray = urls.map(url=>fetch(url));
  for await (let data of dataInArray){
        const dataConvetedtoObject=await data.json()



Screenshot (139).png

Thankyou for Reading,

Comments (1)

Catalin Pit's photo

I've just heard of jsonplaceholder.typicode.com now. Thank you!