JSPM

@extra-array/find-right.min

2.2.12
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 330
  • Score
    100M100P100Q41838F
  • License MIT

Finds index of rightmost value passing the test.

Package Exports

  • @extra-array/find-right.min

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@extra-array/find-right.min) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Finds index of rightmost value passing the test.

This is part of package extra-array.

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

array.findRight(x, fn, [ths]);
// x:   an array
// fn:  test function (v, i, x)
// ths: this argument
// --> index of value, -1 if not found
const array = require('extra-array');

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

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

references