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);
相關文章
相關標籤/搜索