1 import optional: some, none;
2 import ddash.range.front;
3 assert([1, 2].nth(1).frontOr(1) == 2);
4 assert((int[]).init.nth(1).frontOr(9) == 9);
5
6 assert([1, 2].nth(1) == some(2));
7 assert((int[]).init.nth(1) == none);
8
9 assert([1, 2, 3].nth!(Yes.wrap)(10) == some(2));
Gets the element at index n of a range