Internal
Creates a new generator that flattens the input iterable. Flattening means that the generator yields elements of the inner iterables, one level deep.
The element type of the elements of iterables in the input iterable
The input iterable
A new generator with elements from the iterables in the input iterable
const input = [[1, 2], [3, 4], [5, 6]];const result = [...flatten(input)];console.log(result); // [1, 2, 3, 4, 5, 6] Copy
const input = [[1, 2], [3, 4], [5, 6]];const result = [...flatten(input)];console.log(result); // [1, 2, 3, 4, 5, 6]
Generated using TypeDoc
Creates a new generator that flattens the input iterable. Flattening means that the generator yields elements of the inner iterables, one level deep.