我注意到我不能在localStorage
?
localStorage.setItem("item1", true);
alert(localStorage.getItem("item1") + " | " + (localStorage.getItem("item1") == true));
true | false
当我尝试测试localStorage.getItem("item1") == "true"
它时总是发出警报警报为真...如何将项目设置localStorage
为真?
即使它是一个字符串,我认为只会===
检查类型?
所以
alert("true" == true); // should be true?