首页 > 其他分享 >js filter object keys All In One

js filter object keys All In One

时间:2023-01-10 17:35:21浏览次数:42  
标签:key keys object rest filter https

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

相关文章