javascript if 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');
}