subs method

List<List<T>> subs()

Returns the all partial list of the list.

[].subs();
[[]]
[3].subs();
[[], [3]]
[2, 3].subs();
[[], [3], [2], [2, 3]]
[1, 2, 3].subs();
[[], [3], [2], [2, 3], [1], [1, 3], [1, 2], [1, 2, 3]]

Implementation

List<List<T>> subs() {
  return this._subs([...this]);
}