function nth<T>(arr: T[], n: number): T | undefined { return arr[n] }
nth([10, 20, 30], 1) // β 20nth<T> retrieves the element at index n, returning undefined for out-of-bounds indices.
Challenge: Implement nth<T>(arr: T[], n: number): T | undefined returning the element at index n.
nth([10, 20, 30], 1) // β 20
nth([1, 2, 3], 5) // β undefined