HTML5 LocalStorage: Memeriksa apakah ada kunci [duplikat]

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