array-findindex

2018-12-08 admin

array-findindex是什么

什么是array-findindex,## Usage

array-findindex使用教程帮助文档

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

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-47599.html

文章标题:array-findindex

回到顶部