If I declare a JavaScript boolean variable like this:(如果我声明一个像这样的JavaScript布尔变量:)
var IsLoggedIn;
And then initialize it with either true
or 1
, is that safe?(然后用true
或1
初始化它,这样安全吗?) Or will initializing it with 1
make the variable a number?(或者用1
初始化它使变量成为一个数字?)
ask by mrblah translate from so