JS中各种变量类型在条件判断为false的情况

   var a = undefined;     ->false
    var a = 0;            ->false
    var a = 0.0;        ->false
    var a = NaN;        ->false
    var a = "";            ->false
    var a = null;        ->false
    var a = false;        ->false
    var a                 ->false
function a(){ };    
  //调用无返回值的函数,默认返回值是undefined 
  a()           ->false

 

posted @ 2018-11-04 08:43  喵星人~  阅读(3026)  评论(0编辑  收藏  举报