ARRAY
Returns an array from its arguments, combining and flattening multiple arrays into a single array. It always returns an array regardless of the types and formats of the arguments.
Parameters
var_args_expressions
* (required) - Arrays or values to create an array from
Returns
Array
Examples
ARRAY(1, 2, 3)
// returns [1,2,3]
ARRAY([1, 2, 3])
// returns [1,2,3]
ARRAY([1, 2, 3, [4, 5], [6, [7, 8]]])
// returns [1,2,3,4,5,6,7,8]
ARRAY()
// returns []
ARRAY([])
// returns []
ARRAY(ARRAY(ARRAY([1, 2, ARRAY(3, 4)])))
// returns [1,2,3,4]
Updated about 1 year ago