I noticed that I cannot set boolean values in localStorage
?
localStorage.setItem(item1, true);
alert(localStorage.getItem(item1) + | + (localStorage.getItem(item1) == true));
Always alerts true | false
when I try to test localStorage.getItem(item1) == true
it alerts true ... How can I set an item in localStorage
to true?
Even if it's a string, I thought only ===
would check the type?
So
alert(true == true); // should be true?