function tail<T>(arr: T[]): T[] { return arr.slice(1) }
tail([1, 2, 3]) // β [2, 3]
tail([1]) // β []tail<T> returns all elements except the first, preserving the generic element type.
Challenge: Implement tail<T>(arr: T[]): T[] returning all elements except the first.
tail([1, 2, 3]) // β [2, 3]
tail([1]) // β []