title: Why my program alerting undefined value
body: <pre><code>var cars = ["nano", "bmw"];
  var bikes = ["pulsar", "splander"];
  var con = [];
  var foundCars = [];
  var foundBikes = [];
  var notFoundTransport =[];
  for(var i = 0; i&lt;cars.length; i++){
      con = prompt("enter your tranport name");
      if(con[i] == cars[i]){
      foundCars.push(con[i]);
      } 
  }
  for(var i = 0; i&lt;2; i++){
  alert(foundCars[i]);
  }
  </code></pre>
  
  <p>Why it shows the undefined value after alerting foundcars array
  eg, nano bmw 
  it's alert, undefined, undefined
  Please let me know where I am wrong.</p>