- :block
flatten
flatten given collection by eliminating nested blocks
Parameters
flatten collection :literal :block
Attributes
once | do not perform recursive flattening |
Returns
Examples
copyarr: [[1 2 3] [4 5 6]] print flatten arr ; 1 2 3 4 5 6
copyarr: [[1 2 3] [4 5 6]] flatten 'arr ; arr: [1 2 3 4 5 6]
copyflatten [1 [2 3] [4 [5 6]]] ; => [1 2 3 4 5 6]
copyflatten.once [1 [2 3] [4 [5 6]]] ; => [1 2 3 4 [5 6]]