title: Difference between Array.length = 0 and Array =[]?
body: <p>Can some one explain the conceptual difference between both of them. Read somewhere that the second one creates a new array by destroying all references to the existing array and the .length=0 just empties the array. But it didn't work in my case</p>
  
  <pre><code>//Declaration 
  var arr = new Array();
  </code></pre>
  
  <p>The below one is the looping code that executes again and again.</p>
  
  <pre><code>$("#dummy").load("something.php",function(){
     arr.length =0;// expected to empty the array
     $("div").each(function(){
         arr = arr + $(this).html();
     });
  });
  </code></pre>
  
  <p>But if I replace the code with <code>arr =[]</code> in place of <code>arr.length=0</code> it works fine. Can anyone explain what's happening here.</p>