Javascript global array .push returns last added element in array
<p>I am trying to retrieve en array via alert but after every click I get the same value 1 instead of more 1 after each click. I tried both with loop and without. I tried <code>var seats = new Array();</code> too. </p>

<p>What I am doing wrong?   </p>

<pre><code>var seats = [];

function loadSubmitBtn() {
     document.getElementById("btnSubmit").addEventListener("click", function () {
          showArray();
     });
 }

function showArray() {

   seats.push("1");

   var test = "";

   for (i = 0; i &lt; seats .length; i++) {
       test += seats [i];
   }

   alert(test);
   alert(seats);
}
</code></pre>