Open this example in the interactive library
Source code
const words = ["build", "ship", "test"];
console.log((<T,>(items: readonly T[]): T | undefined => items[0])(words));
Sample output
build

Open this example in the interactive library
const words = ["build", "ship", "test"];
console.log((<T,>(items: readonly T[]): T | undefined => items[0])(words));
build