title: localstorage values get reset after refreshing page and inserting new values
body: <p>So, I'm sucessfully saving the values I want to localstorage, but everytime I hit refresh, and insert a new array, these values are cleared and only the new array stays. How do I make it so all the values are saved permanently? Thanks!</p>
  
  <pre><code>let users = []
  let logged = false;
  let indexUtilizador = 0;
  
  window.onload = function () {
  
  class User {
      constructor(user, pass, email, tipouser,lastId) { 
          this.user = user
          this.pass = pass
          this.email = email
          this.tipouser = tipouser  ou docente    
          this._id = User.getLastId() + 1
      }
  }
  
  
  let registerUser = document.getElementById('newAccount')
  
  document.getElementById("register").onclick = function() {
      console.log("Ola")
      let user = document.getElementById('user').value
      let pass = document.getElementById('pass').value
      let email = document.getElementById('email').value
      let usertype = document.getElementById('usertype').value
  
      let newUser = new User(user, pass, email, usertype)
  
      users.push(newUser)
  
      localStorage.setItem("users", JSON.stringify(users))
  
      }
  
  }
  </code></pre>