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);
相關文章
相關標籤/搜索