This is a variation of Tree.merge that renumbers numeric keys in a set of map-like objects. It is conceptually similar to, but more general than, the standard Array.prototype.concat method.
If the supplied maps all have numeric keys, the result is a flat array:
$ ori "Tree.concat(['a', 'b'], { 1: 'c', 2: 'd' })"
- a
- b
- c
- d
If the maps have a mixture of numeric and non-numeric keys, the result is a Map that renumbers the numeric keys and leaves the non-numeric keys alone:
$ ori "Tree.concat(['a', 'b'], { x: 1, y: 2 }, ['c', 'd' ])"
"0": a
"1": b
x: 1
y: 2
"2": c
"3": d
When used with arrays, the concat function performs the same function as the ... spread operator:
$ ori "Tree.concat(['a', 'b'], ['c', 'd'])
- a
- b
- c
- d
$ ori "[...['a', 'b'], ...['c', 'd']]"
- a
- b
- c
- d