The Fauna service will be ending on May 30, 2025.

For more information on the service wind down, see our announcement and the Fauna Service End-of-Life FAQ.

array.flatten()

Flatten an Array by one level.

Signature

flatten() => Array<Any>

Description

Flattens an Array by one level, reducing its dimensions by one.

The calling Array must be a multi-dimentional Array. If there are non-Array elements in the Array, an error is returned.

Parameters

None

Return value

Type Description

Array<Any>

Flattened Array.

Examples

fqlCopied!
[[1, 2], [3, 4]].flatten()
[
  1,
  2,
  3,
  4
]
\