js check if session storage exists

99

js check if session storage exists -

if (localStorage.getItem("username") === null) {
  //...
}

how to check is the key of a localstorage is emopty -

if (localStorage.getItem("username") === null) {
  //...
}

Comments

Submit
0 Comments