last-index-of

0.1.0 • Public • Published

last-index-of NPM version

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

Usage

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

Run tests

npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

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.

Package Sidebar

Install

npm i last-index-of

Weekly Downloads

1

Version

0.1.0

License

none

Last publish

Collaborators

  • doowb
  • jonschlinkert