how to check if username is in localstorage exists code example
Example: check if localstorage key exists js
if("user" in localStorage){
alert('yes');
} else {
alert('no');
}
if("user" in localStorage){
alert('yes');
} else {
alert('no');
}