title: Filtering an Array of Objects using Jquery $.grep without an Object Wrapper
body: <p>Filtering works fine for an object (<code>data</code>) wrapping around an array of objects:</p>
  
  <pre><code>var arr = {"data":
   [
    {"name":"Alan","height":"171","weight":"66"},
    {"name":"Ben","height":"182","weight":"90"},
    {"name":"Chris","height":"163","weight":"71"}
   ]
  };
  
  var new_arr = $.extend(true, arr);
  
  new_arr.data = $.grep(new_arr.data, function(n, i){
    return n.weight &gt; 70;
  });
  
  alert(new_arr.data.length); // answer is 2
  </code></pre>
  
  <p>However, filtering without the object wrapper doesn't.</p>
  
  <pre><code>var arr = [
    {"name":"Alan","height":"171","weight":"66"},
    {"name":"Ben","height":"182","weight":"90"},
    {"name":"Chris","height":"163","weight":"71"}
   ];
  
  var new_arr = $.extend(true, arr);
  
  new_arr = $.grep(new_arr, function(n, i){
    return n.weight &gt; 70;
  });
  
  alert(new_arr.length); // answer is 1 instead of 2
  </code></pre>
  
  <p>I am not sure where is the problem. Can anyone point out. Thanks!</p>