Get the index of the last element in an array that returns truthy for the given value, using strict equality for comparisons.
Install with npm
npm i last-index-of --save
var lastIndexOf = require('last-index-of');
lastIndexOf(['a', 'b', 'c', 'a', 'b', 'c'], 'a');
//=> 3
lastIndexOf(['a', 'b', 'c'], 'd');
//=> -1
lastIndexOf(['a', 'b', 'a', 'b', 'a', 'b'], 'b', 3);
//=> 3
npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright (c) 2014 Jon Schlinkert
Released under the MIT license
This file was generated by verb on December 12, 2014. To update, run npm i -g verb && verb
.