js中if断定为false的分类

总结 公式 function test(a){ if(a){ console.log(true); }else{ console.log(false) } } 验证 undefined // undefined var a; typeof a; test(a); string //空字符串 注意:若是引号中含有空格则为true。 a = ""; typeof a; test(a);
相关文章
相关标签/搜索