JavaScript 代码优化:使用 `return` 和 多行箭头函数
优化后的代码如下:
this.tableData = this.tableData.filter((item) => {
return !appraiseeList.some((appraisee) => item.assesseeId === appraisee.id);
});
优化说明:
- 将箭头函数的大括号移动到了多行的位置,使代码更易读。
- 添加了
return关键字,以明确函数的返回值。
原文地址: https://www.cveoy.top/t/topic/pTQG 著作权归作者所有。请勿转载和采集!