getrow(x: matrix,n: number,): array
Get a row of a matrix.
Retrieves a specific row from a 2D matrix. If the input is not a matrix or if the row index is invalid, an error is thrown.
Get the first row
Get the first row
import { assertEquals, assertThrows } from "jsr:@std/assert"; assertEquals(getrow([[5, 6, 5], [7, 8, -1]], 0), [5, 6, 5]); // [5, 6, 5]
x: matrix
The input matrix (2D array) from which to retrieve the row.
An array representing the specified row of the matrix.