localstorage values resetting after refresh
<p>i want to have an array (converted also to a localStorage value) box where the value of '#textInput' is added to the localStorage each time, however after refreshing and entering a new value, the new value is not added to the localStorage, but replaces it. I believe this is because after refreshing the data from users[] is set to null, but dont know how to fix it</p>

<pre><code>var users = new Array();
var valueChanger = 1;

alert(localStorage.getItem('usernames'));

function addValue() {
  var newUser = $('#textInput').val();
  users.push(newUser);
  localStorage.setItem('usernames', users);
  alert(localStorage.getItem('usernames'));
}
</code></pre>