function isEmpty(value) {
return (Array.isArray(value) && value.length === 0) || (Object.prototype.isPrototypeOf(value) && Object.keys(value).length === 0);
}
js 判断数组是否为空
最新推荐文章于 2024-06-22 13:14:23 发布
function isEmpty(value) {
return (Array.isArray(value) && value.length === 0) || (Object.prototype.isPrototypeOf(value) && Object.keys(value).length === 0);
}