> For AI agents: the complete documentation index is available at https://massaman.dev/llms.txt, the full documentation bundle is available at https://massaman.dev/llms-full.txt.

# pick (Functional Programming) es-toolkit

Creates a function that keeps only the given keys of an object. Use it with [`pipe`](https://massaman.dev/reference/fp/pipe.md).

```typescript
const result = pipe(obj, pick(keys));
```

::: info

Prefer the original es-toolkit [`pick`](https://massaman.dev/reference/object/pick.md) in ordinary code. Use this `fp` variant when composing transformations with [`pipe`](https://massaman.dev/reference/fp/pipe.md).

:::

## Usage

`pick` returns a new object that contains only the specified `keys` from the input object. Keys that are not present on the input are skipped.

```typescript
import { pick, pipe } from 'es-toolkit/fp';

pipe({ a: 1, b: 2, c: 3 }, pick(['a', 'c'])); // => { a: 1, c: 3 }
```

#### Parameters


keysreadonly K[]required

The keys to copy into the new object.

#### Returns

A function that maps an object `T` to a new object with only the picked keys.

```typescript
(obj: T) => Pick<T, K>
```


Source: es-toolkit

Re-exported verbatim from [`es-toolkit`](https://es-toolkit.dev/fp/reference/pick.html). Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.
