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.
let result = 1;
for (counter = 1; counter < 10; counter ++) {
result = result * 2;
}
console.log(result);