在这段代码中,myVar
的值是什么?将表现为 true
和 false
?
if(myVar){}
例如,在 JavaScript 中,以下值是假的
null
undefined
0
''
false
最佳答案
对象
false
if the instance isnull
;true
otherwise
字符串
false
if the value isnull
or the empty string""
;true
otherwise
数字、整数或 uint
false
if the value isNaN
or0
;true
otherwise
空
false
来自 here .
关于actionscript-3 - 什么在变量的 if 语句中作为真(或假)传递,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6493165/