title: JavaScript: why [object Array] is not iterable with for( i of array)
body: <p>I am having weird issue. I wanted to replace <code>for (let i=0;i&lt;arr.length;i++)</code> with <code>for( const[key,val] of arr)</code>
  but I am getting error <code>.for is not iterable</code></p>
  <p>When I check my array with <code>Object.prototype.toString.call(arr)</code> i get <code>[object Array]</code>
  I am not insisting on using that  form, but just want to understand why is this happening:
  my array looks like (array of objects):</p>
  <pre><code>[
    {
      fieldname: 'files',
      originalname: 'User Manual 3.0.pdf',
      encoding: '7bit',
      mimetype: 'application/pdf',
      buffer: &lt;Buffer 25 50 44 46 2d 31 2e 37 0d 0a 25 b5 b5 b5 b5 0d 688657 more bytes&gt;,
      size: 688707
    }
  ]
  </code></pre>