Returns the element at the specified position in the source array.
It tries to infer the type of the element at the specified position. When not possible, it produces the same wide type as the "at" method of the source array.
at(0)([1, 2, 3]); // 1 with type numberat(1)([1, 2, 3] as const); // 2 with literal type 2at(-1)([1, 2, 3] as const); // 3 with literal type 3 Copy
at(0)([1, 2, 3]); // 1 with type numberat(1)([1, 2, 3] as const); // 2 with literal type 2at(-1)([1, 2, 3] as const); // 3 with literal type 3
Returns the element at the specified position in the source array.
It tries to infer the type of the element at the specified position. When not possible, it produces the same wide type as the "at" method of the source array.
See
Example