<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@easyops-cn/brick-next-pipes](./brick-next-pipes.md) &gt; [findIndex](./brick-next-pipes.findindex.md)

## findIndex() function

从一个数组中找到第一个匹配的元素的位置。

 Array

**Signature:**

```typescript
export declare function findIndex(array: unknown[], predict: string | number | Record<string, unknown> | [string | number, unknown], fromIndex?: number): number;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  array | unknown\[\] | 要搜索的数组。 |
|  predict | string \| number \| Record&lt;string, unknown&gt; \| \[string \| number, unknown\] |  |
|  fromIndex | number | 从哪个位置开始搜索。 |

**Returns:**

number

返回找到的元素的位置，没有找到时返回 `-1`<!-- -->。

## Remarks

透传调用 [\_.findIndex](https://lodash.com/docs/#findIndex)<!-- -->。

