title: javascript object is getting overwritten
body: <p>I am trying to get user input and push the value to array. But the array just copies the last value entered to all previous values. Not sure where am I going wrong. </p>
  
  <pre><code>    var arrTest = [];
      var objTest = {};
      var inputName = prompt("Enter name");
      var inputValue = prompt("Enter value");
  
  while (inputName.length &gt; 0 &amp;&amp; inputValue &gt; 0) { 
      objTest.name = inputName;
      objTest.value = inputValue;
      arrTest.push(objTest);
      inputName = prompt("Enter name");
      inputValue = prompt("Enter value");
  }
  
  printDetails(arrTest);
  }
  
  function printDetails(arrN){
      var vOutput = ""
      for(var vIndex = 0; vIndex &lt; arrN.length ; vIndex++){
      vOutput = vOutput +" Name: " + arrN[vIndex].name+ " Value :" + dogN[vIndex].value+ ";
      }
  document.getElementById("output").innerHTML=vOutput;
  }
  </code></pre>
  
  <p>If is enter just 1 value test 1, the output is </p>
  
  <blockquote>
    <p>Name: test Value : 1</p>
  </blockquote>
  
  <p>If is enter just 2 values test 1, best 2 the output is </p>
  
  <blockquote>
    <p>Name: best Value : 2
    Name: best Value : 2</p>
  </blockquote>
  
  <p>My expectation is the value should be :</p>
  
  <blockquote>
    <p>Name: test Value : 1
    Name: best Value : 2</p>
  </blockquote>
  
  <p>what am I doing wrong?</p>