HTML5 LocalStorage: Sprawdzanie, czy istnieje klucz [duplikat]
if (localStorage.getItem("username") === null) {
//...
}
Blue Bear
if (localStorage.getItem("username") === null) {
//...
}