// 过滤无效的属性 const values = { name: '', age: '', address: '北京', }; Object.keys(values).map(key => (!values[key] ? delete values[key] : '')); console.log(values, 'values'); // {address: '北京'}