I am testing to see if a localstorage key exists or not.
So first I've done a console.log to see what's inside the value...
console.log(localStorage.getItem('mykey'));
This returns null
So I've done this for a condition:
if (localStorage.getItem('mykey') === null) {
console.log('It is null');
}
But although I know it's null it's not showing:
console.log('It is null');
What could the problem be?