I am trying to insert the value of newUsername
into the localStorage
setUsernamesArray. However, my current code overwrites the existing value instead of adding to it.
Code
$('#signUpButton').click(function() {
var newUsername = $('#usernameSignInBox').val();
signedUpUsernames.push(newUsername);
localStorage.setItem('setUsernamesArray', signedUpUsernames);
});