title: for(var i in aArray) VS for(i=0; i<aArray.length; i++)
body: <p>I just want to ask if the <strong>in_array_orig</strong> and  <strong>in_array_new</strong> is just the same.
  and also im confused on the result when comparing both array (<strong>aArr1</strong> vs <strong>aArr2</strong>).</p>
  
  <p>can someone explain me. thanks</p>
  
  <p>Here is my sample test code</p>
  
  <pre><code>function echo(s)
  {
      document.write(s);
  }
  
  function in_array_orig(oItem, aArray)
  {   
      for (var i=0; i&lt;aArray.length; i++) if (aArray[i] == oItem) return true;
  
      return false;
  }
  
  function in_array_new(oItem, aArray)
  {
      for (var i in aArray) if (aArray[i] == oItem) return true;
  
      return false;
  }
  
  var a = ['gab', '24', 'manila'];
  
  var aArr1 = [1];
  var b = {0:aArr1, 1:24, 2:'manila'};
  
  var aArr2 = [1];
  
  
  echo(in_array_orig(24, a)); // true
  echo(in_array_new(24, b)); // true
  
  echo(in_array_orig(aArr2, b)); // false
  echo(in_array_new(aArr2, b)); // false
  
  echo ((aArr1==aArr2)); // false
  echo ((aArr1===aArr2)); // false
  </code></pre>
  
  <p>thanks in advance</p>