@extra-iterable/find-right.min

Finds last value passing a test.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@extra-iterable/find-right.min
512.5.222 years ago3 years agoMinified + gzip package size for @extra-iterable/find-right.min in KB

Readme

Finds last value passing a test. :package: :smileycat: :running: :vhs: :moon: :scroll: :newspaper: :bluebook:
Alternatives: find, findRight, findAll.
Similar: search, scan, find.

This is part of package extra-iterable.

This is browserified, minified version of @extra-iterable/find-right.
It is exported as global variable iterablefindRight.
CDN: unpkg
, jsDelivr.



iterable.findRight(x, ft);
// x:  an iterable
// ft: test function (v, i, x)

const iterable = require("extra-iterable");

var x = [1, 2, 3, 4, 5];
iterable.findRight(x, v => v % 2 == 0);
// 4              ^

iterable.findRight(x, v => v % 2 == 1);
// 5                 ^



References