Q:

check if localstorage key exists

if (localStorage.getItem("username") === null) {
  //...
}
2
if("user" in localStorage){
   alert('yes');
} else {
   alert('no');
}
0

New to Communities?

Join the community