title: Javascript - for-of loop crashing when trying to loop through an object
body: <p>I have this object passed in by a function</p>
  
  <p><a href="https://i.stack.imgur.com/z557x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/z557x.png" alt="enter image description here"></a></p>
  
  <p>and then I want to loop through it with this code</p>
  
  <pre><code>    let formData = new FormData();
      let item = {};
      let i = 0;
      for (item of files) {
          formData.append('file' + i, files[i]);
          formData.append('filesNumber', i + 1);
          i++;
      }
  </code></pre>
  
  <p>but when the execution reaches the declaration of the for loop, it crashes with this error</p>
  
  <pre><code>Uncaught TypeError: files[Symbol.iterator] is not a function
  </code></pre>
  
  <p>What is wrong?</p>