00015
LastOfArray
type Last<T extends any[]> = T['length'] extends 0 ? never : T extends [infer First,...infer Rest] ? Rest['length'] extends 0 ? First : Last<Rest> : never;
type Last<T extends any[]> = T['length'] extends 0 ? never : T extends [infer First,...infer Rest] ? Rest['length'] extends 0 ? First : Last<Rest> : never;