It implements the logic consistent with Array.flat,
handling non-iterable values without throwing errors (unlike spread), and with optional depth support.
Note that when handling a synchronous iterable, this operator can only expand synchronous sub-iterables.
But when handling an asynchronous iterable, it can expand mixed sub-iterables, i.e. any combination of
synchronous and asynchronous sub-iterables.
Expands / flattens sub-iterables up to the specified
depth
(default is 1).It implements the logic consistent with Array.flat, handling non-iterable values without throwing errors (unlike spread), and with optional
depth
support.Note that when handling a synchronous iterable, this operator can only expand synchronous sub-iterables. But when handling an asynchronous iterable, it can expand mixed sub-iterables, i.e. any combination of synchronous and asynchronous sub-iterables.
Compare it to a more strict spread operator.