How can I check if an item is set in localStorage
?(如何检查localStorage
是否设置了项目?)
Currently I am using(目前我正在使用)
if (!(localStorage.getItem("infiniteScrollEnabled") == true || localStorage.getItem("infiniteScrollEnabled") == false)) {
// init variable/set default variable for item
localStorage.setItem("infiniteScrollEnabled", true);
}
ask by Jiew Meng translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…