array.prototype.findlastindex (1.2.6)

Published 2026-02-24 13:52:59 +00:00 by atheaadmin

Installation

registry=
npm install array.prototype.findlastindex@1.2.6
"array.prototype.findlastindex": "1.2.6"

About this package

array.prototype.findlastindex Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ESnext spec-compliant Array.prototype.findLastIndex shim/polyfill/replacement that works as far down as ES3.

This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the proposed spec.

Because Array.prototype.findLastIndex depends on a receiver (the this value), the main export takes the array to operate on as the first argument.

Getting started

npm install --save array.prototype.findlastindex

Usage/Examples

var findLastIndex = require('array.prototype.findlastindex');
var assert = require('assert');

var arr = [1, [2], [], 3, [[4]]];
var isNumber = function (x) { return typeof x === 'number' };

assert.deepEqual(findLastIndex(arr, isNumber), 3);
var findLastIndex = require('array.prototype.findlastindex');
var assert = require('assert');
/* when Array#findLastIndex is not present */
delete Array.prototype.findLastIndex;
var shimmed = findLastIndex.shim();

assert.equal(shimmed, findLastIndex.getPolyfill());
assert.deepEqual(arr.findLastIndex(isNumber), findLastIndex(arr, isNumber));
var findLastIndex = require('array.prototype.findlastindex');
var assert = require('assert');
/* when Array#findLastIndex is present */
var shimmed = findLastIndex.shim();

assert.equal(shimmed, Array.prototype.findLastIndex);
assert.deepEqual(arr.findLastIndex(isNumber), findLastIndex(arr, isNumber));

Tests

Simply clone the repo, npm install, and run npm test

Dependencies

Dependencies

ID Version
call-bind ^1.0.8
call-bound ^1.0.4
define-properties ^1.2.1
es-abstract ^1.23.9
es-errors ^1.3.0
es-object-atoms ^1.1.1
es-shim-unscopables ^1.1.0

Development Dependencies

ID Version
@es-shims/api ^2.5.1
@ljharb/eslint-config ^21.1.1
auto-changelog ^2.5.0
encoding ^0.1.13
es-value-fixtures ^1.7.1
eslint =8.8.0
evalmd ^0.0.19
for-each ^0.3.5
functions-have-names ^1.2.3
globalthis ^1.0.4
has-strict-mode ^1.1.0
hasown ^2.0.2
in-publish ^2.0.1
npmignore ^0.3.1
nyc ^10.3.2
object-inspect ^1.13.4
safe-publish-latest ^2.0.0
tape ^5.9.0

Keywords

Array.prototype.findLastIndex find findLast findLastIndex array ESnext shim polyfill last es-shim API
Details
npm
2026-02-24 13:52:59 +00:00
1
Jordan Harband
MIT
latest
9.3 KiB
Assets (1)
Versions (1) View all
1.2.6 2026-02-24