js - 判断 null ,undefined
访问量: 1344
参考:https://stackoverflow.com/questions/2647867/how-to-determine-if-variable-is-undefined-or-null
if( a == null) ....
在js 中, null == undefined. 所以上面的判断,可以同时拦截 null, undefined两种情况。
访问量: 1344
参考:https://stackoverflow.com/questions/2647867/how-to-determine-if-variable-is-undefined-or-null
if( a == null) ....
在js 中, null == undefined. 所以上面的判断,可以同时拦截 null, undefined两种情况。