title: Javascript array type casting
body: <p>I've found something interesting and I don't know why it's happening.</p>
  
  <p>If I try in google chrome developer tools, the following two staments</p>
  
  <pre><code>(Array([1,2,3])).filter(function (item, index, array) {
      return item === 1;
  }); ==&gt; []
  </code></pre>
  
  <p>and</p>
  
  <pre><code>([1,2,3]).filter(function (item, index, array) {
       return item === 1;
  }); ==&gt; [1]
  </code></pre>
  
  <p>The results are an empty array for the first statement and array with a single value (1) for the second</p>
  
  <p>Inspecting the parameters for the callback function, i found that in the first statement the arguments are (array, index, value) and for the second statemente are(value, index, array).</p>
  
  <p>Inspecting with typeof and constructor of both objects the result are the expected, and the same "object", and Array.</p>
  
  <p>Why is this happening? </p>
  
  <p>Thanks</p>