title: How to access values of array in javascript
body: <p>Code:</p>
  
  <pre><code>var testarray = [];
  var test1 = "ashutosh";
  var test2 = "ashutosh2";
  
  if (test1 != test2) {
    testarray.push = "ashutosh3";
    testarray.push = "ashutosh4";
    alert(testarray.length);
  }
  
  if (testarray.length != 1) {
    alert(testarray.length);
    alert(testarray[testarray.length - 1]);
    alert(testarray[testarray.length - 2]);
  }
  </code></pre>
  
  <p>But when all the alerts are showing up <code>undefined</code>. I have no clue why is this happening.</p>