+ 1
Related to JavaScript if and else statements
What is meant by following lines if(typeof(Storage)!=="undefined") else {"your browser does not support local storage"}
1 Answer
+ 3
For a javascript engine, this code means "syntax error"...
But for an human it would be translated to this kind of correct code:
if (typeof(Storage)!=="undefined") {}
else { alert("your browser does not support local storage") }
wich translated in human words means: "if object Storage exists do nothing, else display message to user", wich could be done less verbosely by:
if (!Storage) { alert("your browser..." }