<!-- 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; [map](./brick-next-pipes.map.md)

## map() function

通过填充调用数组中各项的指定属性来创建一个新数组。

 Array

**Signature:**

```typescript
export declare function map(value: unknown[], key: string): unknown[];
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  value | unknown\[\] | 数组。 |
|  key | string | 属性名（路径）。 |

**Returns:**

unknown\[\]

返回新数组，当输入不是数组时返回空数组。

## Example


```ts
map([{ count: 123 }], "count")
// Returns `[ 123 ]`

map([{ item: { name: "xyz" } }, {}], "item.name")
// Returns ["xyz", undefined]
```


