Array.diagonal()


Array.diagonal(nthDiagonalIndex)

Extract the diagonal at nthDiagonalIndex (-ve for diagonals below the proper diagonal, and zero for the proper diagonal).

|4|.diagonal(0..2)

|4|.diagonal(0)

|4|.diagonal(-1..1)