> 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.values.md).

# map.values()

The modified `map.values()` function returns all values or values of [`$keys`](#usdkeys...) from [`$map`](#usdmap).

{% hint style="info" %}
The modified `map.values()` function, by adding arbitrary parameter [`$keys...`](https://docs.angular-package.dev/sass/map/pages/OqdQOm2cXFfqhJEFHZCh#usdkeys...) to return values of the specified keys.
{% endhint %}

{% code lineNumbers="true" %}

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

// The `map.values()` function.
@function values($map, $keys...) {
  @if list.length($keys) > 0 {
    @for $i from 1 through list.length($keys) {
      $keys: if(
        map.has-key($map, list.nth($keys, $i)),
        list.set-nth($keys, $i, map.get($map, list.nth($keys, $i))),
        $keys
      );
    }
  } @else {
    $keys: map.values($map);
  }
  @return $keys;
}
```

{% endcode %}

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

### Parameters

#### `$map`

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

#### `$keys...`

The keys to retrieve values from [`$map`](#usdmap).

### Return

The return value is a comma-separated list of values retrieved from [`$map`](#usdmap).

## Examples

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

// Examples.
// key string
@debug map.values((a: 1, b: 2, c: 3), 'a', 'b', 'c'); // (1, 2, 3)

// different map order
@debug map.values((b: 2, a: 1, c: 3), 'a', 'b', 'c'); // (1, 2, 3)

// different map order + keys
@debug map.values((b: 2, a: 1, c: 3), 'c', 'b', 'a'); // (3, 2, 1)
@debug map.values((a: 1, b: 2, c: 3), 'b', 'c'); // (2, 3)

// key list
@debug map.values(((a, b): 1, b: 2, c: 3), 'a', (a, b), 'c'); // ("a", 1, 3)

// key map
@debug map.values((b: 2, (a: b): 1, c: 3), 'a', (a: b), 'c'); // ("a", 1, 3)

// default functionality
@debug map.values((a: 1, b: 2, c: 3)); // (1, 2, 3)

```
