JavaScript中判断对象的值是否为undefined、null

1.判断 undefined

if (typeof(值) == "undefined")

2.判断 null

if (!值 && typeof(值)!=”undefined” && 值 !=0)

猜你喜欢

转载自www.cnblogs.com/Anthony518/p/10897025.html