前端判断数据类型为null

var type = null

//判断

if(!type && typeof type != "undefined" && type != 0){

   //console.log("数据为null");

}else{

  //console.log("不为null的数据");

}

 
posted @ 2022-05-27 14:37  JIM-T  阅读(393)  评论(0)    收藏  举报