How to run these asynchronous functions in loop, sequentially? : <p>Below written javascript code runs asynchronously and produces output in the following format.</p>

<pre><code>const check = () =&gt; {
    const arr = [3,2,1]

    arr.forEach(async (val) =&gt; {
        await setTimeout(() =&gt; console.log(val), val*1000)
    })
}

check();
</code></pre>

<p>The actual output is:</p>

<pre><code>1
2
3
</code></pre>

<p>But I want output in the following format:</p>

<pre><code>3
2
1
</code></pre>
