array_merge Filter

Merges the given array with the original array. If a string key in the given items matches a string key in the original array, the given item’s value will overwrite the value in the original array

{{ {'key1':'value1'}|array_merge({'key2':'value2'})|json_encode }}

{# {"key1":"value1","key2":"value2"} #}