up.util.findResult(list, tester)

JavaScript function

Consecutively calls the given function with each element in the given list. Returns the first truthy return value.

Returns undefined if the function does not return a truthy value for any element in the list.


Parameters

list
required
Type: List | Iterator
tester
required

A function that will be called with each element and (optional) iteration index.

Type: Function(element): any

Return value

Type: any | undefined