js filter object keys All In One
Q: 这段 js 代码如何优化
// this.form = {status: "1", ...}
// this.searchData = {status: "2", interviewStatus: "1", isChoooseAllDelivery: false, ...}
async search() {
delete this.searchData.interviewStatus;
if(this.form.status === "1") {
delete this.searchData.status;
} else {
delete this.searchData.isChoooseAllDelivery;
}
}
//
标签:key,keys,object,rest,filter,https
From: https://www.cnblogs.com/xgqfrms/p/17040874.html