json.union

From MapToolDoc
Jump to: navigation, search

json.union() Function

Introduced in version 1.3b53

Returns an JSON Array with the union of all of the JSON Object keys, or JSON Array values. If a value or a key occurs in multiple different objects or arrays, it will only be placed once in the output object or array.

Usage

  1. json.union(array, array, ...)
  1. json.union(object, object, ...)

Parameters

Examples

  1.   [h: array1 = json.append("",1,2,3,4)]
  2.   [h: array2 = json.append("",3,4,5,6)]
  3.   [r: json.union(array1,array2)]

Returns

"[1,2,3,4,5,6]"

See Also

json.merge(), json.intersection()