Skip to content

Flatten should work with deeply nested lists as well #134

Open
@rishabhdeepsingh

Description

@rishabhdeepsingh

This can be achieved by setting a flag in the flatten extension or directly flattening the list.
Need some more discussion.

  final nestedList = [
    [
      1,
      [2, 3]
    ],
    [4, 5, 6]
  ];
  final flattened = nestedList.flatten(); // [1, 2, 3, 4, 5, 6]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions