title: Call function inside a loop
body: <p>I have an array of objects, I need to pass them one by one to a function, but I want to give a 1sec pause between each item in the array:</p>
  <pre><code>async function ChamandoEtiquetas() {
      if(id) {
        if(NumerosEtiquetas) {
          NumerosEtiquetas.forEach(async (Etiqueta) =&gt; {
          await  MontagemFiltro(Etiqueta)
          })
        }
      }
   
    }
  
  async function MontagemFiltro(Etiqueta) {
      var CodigoDeBarras = &quot;teste&quot;;
             await setFiltro(CodigoDeBarras)
    }
  </code></pre>
  <p>I need to do this, because there are 2 functions that are called when changing the &quot;setFiltro&quot;, and it takes a few milliseconds. Because of that the function is only doing what it has to do with the last index of the array</p>