Skip to main content

Home > @jsplumb/util > getAllWithFunction

getAllWithFunction() function#

Find all entries in the given array for which the function f returns true

Signature:

export declare function getAllWithFunction<T>(a: ArrayLike<T>, f: (_a: T) => boolean): Array<T>;

Parameters#

ParameterTypeDescription
aArrayLike<T>Array to search
f(_a: T) => booleanPredicate to use to test each entry

Returns:

Array<T>

The entries for which the predicate returned true, empty array if not found.