900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > Js如何判断undefined和null

Js如何判断undefined和null

时间:2021-08-19 03:13:08

相关推荐

Js如何判断undefined和null

判断是否为undefined

var example = undefined;if (typeof(example) == "undefined"){console.log("undefined")}

判断是否为null

var example = null; if (!example && typeof(example)!='undefined' && example!=0) {console.log("null");}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。