title: the max length of an array in javascript
body: <p>I've met a problem in learning javascript.Here is my code:</p>
  
  <pre><code>var arr = [];
  for (let i = 0; i &lt;4294967296; i=i+1){
      arr[i] = 1;}
  </code></pre>
  
  <p>But both in chrome and firefox,it ended up with something wrong.I know that the max length of an array is 4294967295(2^32-1) in javascript,when i changed 4294967296 to  4294967295, 4294967294 , or a little more smaller,it still didn't work.I also tested it in Node.js,after a while of executing,it just ended with:</p>
  
  <pre><code>FATAL ERROR: invalid array length Allocation failed - JavaScript heap out of memory
  </code></pre>
  
  <p>I don't know why?</p>