过滤对象中的空字段 Annaaaaaaa 2023-12-06 98 阅读1分钟 for (var key in obj) { if ([null, undefined, ''].includes(obj[key])) { delete obj[key] } } console.log(obj)