Version: v0.6.0 - Beta.  We welcome contributors & feedback.  THanks!

Map.merge

merge($otherMap, $softMerge = false)

Description

Merge with the key/value pairs of another map.

The values of $otherMap will overwrite the current map if there are overlapping keys, unless $softMerge is true.

{ a: 1, b: 2 }.merge({ b: 22, c: 33 });
//= { a: 1, b: 22, c: 33 }

// With soft merge
{ a: 1, b: 2 }.merge({ b: 22, c: 33 }, true);
//= { a: 1, b: 2, c: 33 }