Annotated solution
Published September 8, 2026The solution
type First<T extends readonly unknown[]> = T extends [infer H, ...unknown[]] ? H : neverThe common wrong answer
type First<T extends readonly unknown[]> = T extends [infer H] ? H : neverA one-element pattern matches one-element tuples and nothing else. First<[string]> works, First<[1, 2, 3]> falls straight through to never, and the puzzle looks half-solved because one check passes. The pattern has to say "and then anything".
Line by line
[infer H, ...unknown[]]The rest is spread as
unknown[]rather than inferred, because nothing here needs it. Naming what you will not use is the most common way these patterns get harder to read than they are.: neverneveris the honest answer for "there is no such element" — notundefined, which would claim there is an element and its value is missing.
Takeaway
Tuple patterns are exact. [H] means "a tuple of length one", and if you meant "at least one" you have to write the rest of it.

