# pick | @aa-sdk/core

> Overview of the pick function from @aa-sdk/core

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

{/* This file is auto-generated by TypeDoc. Do not edit manually. */}

```ts
function pick(obj, keys): object;
```

Defined in: [aa-sdk/core/src/utils/index.ts:125](https://github.com/alchemyplatform/aa-sdk/blob/main/aa-sdk/core/src/utils/index.ts#L125)

Picks the specified keys from an object and returns a new object containing only those key-value pairs.

## Example

```ts
import { pick } from "@aa-sdk/core";

const picked = pick(
  {
    foo: "foo",
    bar: "bar",
  },
  ["foo"],
); // { foo: "foo" }
```

## Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `obj`
      </td>

      <td>
        `Record`\<`string`, `unknown`>
      </td>

      <td>
        The object from which to pick keys
      </td>
    </tr>

    <tr>
      <td>
        `keys`
      </td>

      <td>
        `string` | `string`\[]
      </td>

      <td>
        A single key or an array of keys to pick from the object
      </td>
    </tr>

  </tbody>
</table>

## Returns

`object`

A new object containing only the picked key-value pairs