title: Trying to run a loop for exactly one second, but the loop runs infinitely. why?
body: <p>i am changing the value of 'aa' after 1 second, but the loop continues to execute.</p>
  <pre><code>let aa = true;
  
  setTimeout(function () {
    aa = false;
  }, 1000);
  
  for (; aa; ) {
    console.log('aaa');
  }
  </code></pre>