它使用了Array.prototype.map()方法对mateList进行遍历,并对每个元素执行一个回调函数。在回调函数中,使用了解构赋值的方式将每个元素的categoryId属性提取出来,并将剩余的属性存储在rest变量中。然后,将rest返回,最终生成一个只包含剩余属性的新数组newArr。
const newArr = mateList.value.map((obj: any) => {
const { categoryId, ...rest } = obj;
return rest;
});