Cara memeriksa apakah variabel penyimpanan lokal ada di JavaScript
if (localStorage.getItem("username") === null) {
//...
}
Blue Bear
if (localStorage.getItem("username") === null) {
//...
}