For loop is executed asynchronously in javascript? : <p>In my example below, why does it log 512, rather than 1?  I understand javascript is synchronous, so shouldn't the logging occur long before the for loop completes?  For this reason, I was expecting result = 1 when logged.</p>

<pre><code>let result = 1;
for (counter = 1; counter &lt; 10; counter ++) {
    result = result * 2;
}
console.log(result);
</code></pre>
