Skip to main content

Array filtering

Less than 1 minutefeaturees-proposal

Array filteringopen in new window

Modules

Types

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): ;
}

Entry points

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

Example

Exampleopen in new window:

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