Get the index of the first element in an array that returns truthy for the given value, using strict equality for comparisons.
Install with npm
$ npm i index-of --save
Install with bower
$ bower install index-of --save
var indexOf = require('index-of');
indexOf(['a', 'b', 'c'], 'b');
//=> 1
indexOf(['a', 'b', 'c'], 'd');
//=> -1
indexOf(['a', 'b', 'c', 'a', 'b', 'c'], 'b', 2);
//=> 4
Other object utils:
array from the start index up to, but not including, the end… moreInstall dev dependencies:
$ npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright © 2015 Jon Schlinkert Released under the MIT license.
This file was generated by verb-cli on June 22, 2015.