map_merge

map_merge($map1, $map2)

Merges two maps together into a new map. Keys in $map2 will take precedence over keys in $map1.

This is the best way to add new values to a map.

All keys in the returned map that also appear in $map1 will have the same order as in $map1. New keys from $map2 will be placed at the end of the map.

Like all map functions, map-merge() returns a new map rather than modifying its arguments in place.

Examples:

map-merge(("foo": 1), ("bar": 2)) => ("foo": 1, "bar": 2)
map-merge(("foo": 1, "bar": 2), ("bar": 3)) => ("foo": 1, "bar": 3)

Parameters:

  • $map1 (Map)
  • $map2 (Map)

Returns:

  • (Map)

Raises:

  • (ArgumentError) if either parameter is not a map
doc_Sass
2016-11-11 13:09:14
Comments
Leave a Comment

Please login to continue.