Transducer composition / syntax sugar for:
comp(filter(pred), takeLast(1))
Yields none or only the last value which passed the predicate check. If src input is given, returns last match found (or undefined).
src
undefined
matchLast((x) => x >= 5, [3, 1, 6, 5, 4, 2]) // 5 transduce( comp( matchLast((x) => x >= 5), map((x) => x * 10) ), last(), [3, 1, 4, 2, 6, 5] ) // 50
predicate function
Generated using TypeDoc
Transducer composition / syntax sugar for:
comp(filter(pred), takeLast(1))
Yields none or only the last value which passed the predicate check. If
src
input is given, returns last match found (orundefined
).matchLast((x) => x >= 5, [3, 1, 6, 5, 4, 2]) // 5 transduce( comp( matchLast((x) => x >= 5), map((x) => x * 10) ), last(), [3, 1, 4, 2, 6, 5] ) // 50