Associative array/Merging: Difference between revisions

m
indented tables to be more centered.
(→‎{{header|Python}}: Used more explicit base.copy() instead of dict(base))
m (indented tables to be more centered.)
Line 4:
Define two associative arrays, where one represents the following "base" data:
 
::::: {| class="wikitable"
|+
| '''Key''' || '''Value'''
Line 17:
And the other represents "update" data:
 
::::: {| class="wikitable"
|+
| '''Key''' || '''Value'''
Line 30:
Merge these into a new associative array that contains every key found in either of the source ones. Each key should map to the value in the second (update) table if that exists, or else to the value in the first (base) table. If possible, do this in a way that does not mutate the original two associative arrays. Obviously this should be done in a way that would work for any data, not just the specific data given here, but in this example the result should be:
 
::::: {| class="wikitable"
|+
| '''Key''' || '''Value'''
Line 42:
| "year" || 1974
|}
<br><br>
 
=={{header|Factor}}==