Open this example in the interactive library
Source code
const words = ["build", "ship", "test"];
console.log((<T extends { length: number }>(v: T) => v.length)(words));
Sample output
3

Open this example in the interactive library
const words = ["build", "ship", "test"];
console.log((<T extends { length: number }>(v: T) => v.length)(words));
3