- Number:0为false,非0为true
- String:""为0、false,非空字符串为true
- Boolean: true为true,false为false
- Object:true
- Undefined/NaN/null: false
JavaScript_数据类型在if条件判断中的真与假
猜你喜欢
转载自blog.csdn.net/Chill_Lyn/article/details/104115338
今日推荐
周排行