how to check if local storage variable exists in javascript

84

how to check if local storage variable exists in javascript -

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

Comments

Submit
0 Comments