title: JavaScript setTimeout() and array
body: <p>Can someone explain me that:
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const array = [0, 1, 2, 4, 8, 16, 32, 16, 8, 4, 2, 1, 0];
  
  for (let i = 0; i &lt; array.length; i++) {
      setTimeout(function () {
          console.log(array[i]);
      }, array[i])
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Why this return 0 1 1 0 2 2 4 4 8 8 16 16 32, instead of array items one by one?</p>