If I declare a JavaScript boolean variable like this:
var IsLoggedIn;
And then initialize it with either true or 1
If you want IsLoggedIn to be treated as a boolean you should initialize as follows:
var IsLoggedIn=true;
If you initialize it with var IsLoggedIn=1; then it will be treated as an integer.
However at any time the variable IsLoggedIn could refer to a different data type:
IsLoggedIn="Hello World";
This will not cause an error.