# map.deep-merge()

The modified `map.deep-merge()` function merges multiple maps by using sass original `deep-merge()`.

{% hint style="info" %}
The function modify original `map.deep-merge()` by adding arbitrary [`$maps...`](#usdmaps...) argument, to deep merge multiple maps.
{% endhint %}

{% code lineNumbers="true" %}

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

// The `map.deep-merge()` function.
@function deep-merge($map1, $map2, $maps...) {
  $map1: map.deep-merge($map1, $map2);
  @each $map in $maps {
    $map1: map.deep-merge($map1, $map);
  }
  @return $map1;
}
```

{% endcode %}

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

### Parameters

#### `$map1`

A map to deep merge with [`$map2`](#usdmap2).

#### `$map2`

A map to deep merge with [`$map1`](#usdmap1).

#### `$maps...`

Multiple maps to deep merge with the merged [`$map1`](#usdmap1) and [`$map2`](#usdmap2).

### Return

The return value is the map built from [`$map1`](#usdmap1), [`$map2`](#usdmap2) and [`$maps`](#usdmaps...).

## Examples

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

// Examples.
@debug map.deep-merge((prefix: spectre), (suffix: end), (affix: name)); // (prefix: spectre, suffix: end, affix: name)

```


---

# 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://docs.angular-package.dev/sass/map/map.deep-merge.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.
