JSPM

@extra-array/find-right

2.9.41
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 17
  • Score
    100M100P100Q88100F
  • License MIT

Finds rightmost value passing a test.

Package Exports

  • @extra-array/find-right

Readme

Finds rightmost value passing a test. 🏃 📼 📦 🌔 📒

Alternatives: find, findRight.
Similar: find, findIndex.
This is part of package extra-array.

array.findRight(x, fn);
// x:  an array
// fn: test function (v, i, x)
const array = require('extra-array');

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

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

references