Skip to content

isEmpty

isEmpty(needle[, strict])

检测是否为空。

返回值:Boolean

参数说明类型可选值默认值
needle待检测对象*
strict启用严格模式。
非严格模式,以下字符串视为空:
'0' 'null' 'undefined' 'false' 'NaN'
Booleanfalse
js
console.log(JW.isEmpty(0));
console.log(JW.isEmpty('0'));
console.log(JW.isEmpty('0', 1));