Skip to main content
Updated with ??
Source Link
Deepak Thomas
  • 3.6k
  • 4
  • 39
  • 39
if(!localStorage.hash) localStorage.hash = "thinkdj"; 

Or

var secret = localStorage.hash || 42; 

Updated:

let scrollEnabled = localStorage?.scrollEnabled??true; 
if(!localStorage.hash) localStorage.hash = "thinkdj"; 

Or

var secret = localStorage.hash || 42; 
if(!localStorage.hash) localStorage.hash = "thinkdj"; 

Or

var secret = localStorage.hash || 42; 

Updated:

let scrollEnabled = localStorage?.scrollEnabled??true; 
Source Link
Deepak Thomas
  • 3.6k
  • 4
  • 39
  • 39

if(!localStorage.hash) localStorage.hash = "thinkdj"; 

Or

var secret = localStorage.hash || 42;