Finds last index of a value.
npm install @extra-array/last-index-of.minFinds last index of a value.
:package:
:smiley_cat:
:running:
:vhs:
:moon:
:scroll:
:newspaper:
:blue_book:
> Alternatives: [indexOf], [lastIndexOf].
> Similar: [search], [indexOf], [isValue], [includes].
> This is part of package [extra-array].
[extra-array]: https://www.npmjs.com/package/extra-array
> This is browserified, minified version of [@extra-array/last-index-of].
> It is exported as global variable array_lastIndexOf.
> CDN: [unpkg], [jsDelivr].
[@extra-array/last-index-of]: https://www.npmjs.com/package/@extra-array/last-index-of
[unpkg]: https://unpkg.com/@extra-array/last-index-of.min
[jsDelivr]: https://cdn.jsdelivr.net/npm/@extra-array/last-index-of.min
``javascript`
array.lastIndexOf(x, v, [i]);
// x: an array
// v: search value
// i: start index (X-1)
`javascript
const array = require("extra-array");
var x = [1, 2, 3, 2, 5];
array.lastIndexOf(x, 2);
// 3 ^
var x = [1, 2, 3, 2, 5];
array.lastIndexOf(x, 2, 2);
// 1 ^
``
- List-Extra.elemIndex: elm
- Array.prototype.indexOf: MDN web docs
- _.lastIndexOf: lodash
- Array.lastIndexOf: sugarjs
[indexOf]: https://github.com/nodef/extra-array/wiki/indexOf
[lastIndexOf]: https://github.com/nodef/extra-array/wiki/lastIndexOf
[search]: https://github.com/nodef/extra-array/wiki/search
[isValue]: https://github.com/nodef/extra-array/wiki/isValue
[includes]: https://github.com/nodef/extra-array/wiki/includes