npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

last-index-of

0.1.0

@jonschlinkert

npmHomeRepoSnykSocket
Downloads:63
$ npm install last-index-of
DailyWeeklyMonthlyYearly

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

  • github/jonschlinkert
  • twitter/jonschlinkert

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.