I would like to know how to check a the value of an item stored in local storage is true or false.
This is what i have , but the if statement isnt working.
function setCBT(){
localStorage.setItem('testObject', true);
}
function alertLocalStorage(){
var object = localStorage.getItem('testObject');
if(object == true) {
alert("This item is true");
}
else {
alert("This item is false");
}
}