Nav

mergeWith

mergeWith(T, V): ?

Keeps the target object intact, then appends to the target object any key-value pairs from the source where the key is not already in the target.

Transform

        
     
1
2
3
4
%dw 2.0
import mergeWith from dw::core::Objects
---
{a: true, b: 1} mergeWith {a: false, c: "Test"}
Output

        
     
1
{"a": false, "b": 1 , "c": "Test"}
mergeWith(Null, T): T

Helper method to make mergeWith null friendly.

mergeWith(T, Null): T

Helper method to make mergeWith null friendly.

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.

+