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