> For the complete documentation index, see [llms.txt](https://docs.angular-package.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.angular-package.dev/sass/map/map.pick.md).

# map.pick()

The `map.pick()` function returns a copy of [`$map`](#usdmap) of [`$keys`](#usdkeys...).

{% code lineNumbers="true" %}

```scss
// Sass.
@use 'sass:list';
@use 'sass:map';

// Functions.
@use 'map.deep-merge.function' as *;
@use 'map.get.function' as *;
@use 'map.set.function' as *;

// Modules.
@use 'pattern';
@use 'pick';

// The `map.pick()` function.
@function pick($map, $keys...) {
  $result: ();
  @each $key in $keys {
    @if type-of($key) == list {
      $result: set(
        $result,
        if(
          list.separator($key) == space,
          ($key),
          if(list.length($key) > 1, list.nth($key, list.length($key)), $key)
        ),
        get($map, $key)
      );
    } @else if pattern.is($key) {
      $result: deep-merge($result, pick.pattern($map, $key...));
    } @else {
      $result: deep-merge(
        $result,
        (
          $key: get($map, $key),
        )
      );
    }
  }
  @return $result;
}
```

{% endcode %}

{% embed url="<https://github.com/angular-package/sass/blob/main/map/_map.pick.function.scss>" %}

### Parameters

#### `$map`

A map from which values of [`$keys`](#usdkeys...) are taken.

#### `$keys...`

List of keys to get the values from [`$map`](#usdmap).

### Return

The return value is a copy of [`$map`](#usdmap) built of [`$keys`](#usdkeys...).

## Examples

```scss
// Use.
@use '@angular-package/sass/map';

// Examples.


```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.angular-package.dev/sass/map/map.pick.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
