【js】typeof

2020-08-19  本文已影响0人  荆棘夏夏
if ( typeof a != "undefined" ) {
}

不要去使用 if( a ) ,因为如果 a 不存在(未声明)则会出错。

上一篇 下一篇

猜你喜欢

热点阅读