跳至主要內容

Array 过滤器

小于 1 分钟featurees-proposal

Array 过滤器open in new window

模块

类型

interface Array<T> {
  filterReject(callbackfn: (value: t, index: number, target: Array<T>) => boolean, thisArg?: any): Array<T>;
}

interface  {
  filterReject(callbackfn: (value: number, index: number, target: ) => boolean, thisArg?: any): ;
}

入口点

core-js/proposals/array-filtering-stage-1
core-js(-pure)/full/array(/virtual)/filter-reject
core-js/full/typed-array/filter-reject

示例

示例open in new window:

[1, 2, 3, 4, 5].filterReject((it) => it % 2); // => [2, 4]