var a = 213123; if(typeof(a) != "undefined" && a.valueOf("string") && a!= ''){ console.log(a);}
[quote=引用 2 楼 KK3K2005 的回复:] if(a){ console.log(a); } 我觉得这样就可以了 js所有空的东西全会解释成 false
[quote=引用 1 楼 showbo 的回复:] null,[] typeof是object,不是undefined 为空是什么意思?
if(a){ console.log(a); } 我觉得这样就可以了 js所有空的东西全会解释成 false
null,[] typeof是object,不是undefined 为空是什么意思?
87,910
社区成员
224,616
社区内容
加载中
试试用AI创作助手写篇文章吧