JSFiddle - React, Tailwind, and code Playground

JavaScript

let fetchExmaple = async function () {
      for (const item of [1,2,3,4,5]) {
        await new Promise((resolve, reject) => {
          setTimeout( function() {
            resolve() 
          }, 2000) 
        }) 
        console.log('next')
      }
    }
    
    fetchExmaple()