# pluck

```erlang
pluck :: (Any key, Collection<Collections> input) => Collection<Any> output
```

## description

Returns a new flattened `Collection` from an input collection of collections. The input collection is flattened by returning the value associated to the provided key of each inner collection. More simply put, `pluck(key) = map(collection => collection[key])`.

## example

```javascript
import { pluck } from 'conductor'

const characters = [{ id: 1, name: 'Luke' }, { id: 2, name: 'Han' }]
pluck('name', characters) // ['Luke', 'Han']
```

Suppose we have a collection of `characters`, each having a `name` and an `id`. Here, we're only interested in retrieving their names, so we flatten the input collection by returning the `name` property of each character.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://conductor.js.org/1.3.0/api-reference/pluck.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
