check if local storage exists js 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');
}