function getProperty(property)
{
console.log(localStorage[property]) //Displays “null”
if(localStorage[property] == null)
{
console.log('Null check')
return false;
}
return localStorage[property];
}
The log outputs "null", but the 'if()' condition does not work. I have tried using ===, but it still doesn't work. Can someone please help?
UPDATE: Thank you to everyone who helped me, this change did the trick
if(localStorage[property] == 'null')