Skip to content

stefanduberg/array-findindex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

array-findindex

Usage

var findIndex = require('array-findindex');
var array = ['a', 'b', 'c', 'd'];

findIndex(array, function (element, index, arr) {
  return element === 'c';
});
// => 2


findIndex(array, function (element, index, arr) {
  return element === 'z';
});
// => -1

Optionally pass in an object as third argument to use as this when executing callback.

Install

$ npm install array-findindex

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published