ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
## isEmpty + [link](./isEmpty "Link to this entry.") + [source](https://github.com/lodash/lodash/blob/4.5.0正式版/lodash.src.js#L9688 "View in source.") + [npm](https://www.npmjs.com/package/lodash.isempty "See the npm package.") ``` _.isEmpty(value) ``` 检查 `value` 是否为空。 判断的依据是除非是有枚举属性的对象,length 大于 `0` 的 `arguments` object, array, string 或类jquery选择器。 ### 参数 1. value (Array|Object|string) 要检查的值 ### 返回值 (boolean) 如果为空返回 `true`,否则返回 `false` ### 示例 ``` _.isEmpty(null); // => true _.isEmpty(true); // => true _.isEmpty(1); // => true _.isEmpty([1, 2, 3]); // => false _.isEmpty({ 'a': 1 }); // => false ```