function removeProperty(obj) {
Object.keys(obj).forEach(item => {
if (obj[item] === '' || obj[item] === undefined || obj[item] === null || obj[item] === 'null') delete obj[item]
})
return obj
}
js 清除对象里的属性值为空的属性
最新推荐文章于 2024-07-17 16:31:28 发布