typescript 数组过滤不须要的对象

const array = [{id:1,name:"a"},{{id:2,name:"b"},{{id:3,name:"c"}]数组 const want = []; this 若是想获得除去id等于2的对象之外的数组spa 可使用Array.filter()orm this .array . filter ( x => x .id !== 2);
相关文章
相关标签/搜索