WLJS LogoWLJS Notebook

KeyUnion

KeyUnion[{assoc1, assoc2, …}] generates a list of associations in which each association has the union of the keys of the associ, padding by inserting values of Missing[…] if necessary.

  • KeyUnion[{assoc1, assoc2, …}, f] uses f[key] as the value associated with a missing key.

Examples

KeyUnion[{<|"a" -> 1|>, <|"b" -> 2|>}]
KeyUnion[{<|"x" -> 1|>, <|"y" -> 2|>}, 0 &]

Please visit the official Wolfram Language Reference for more details.

On this page