Cons
Constructs a new tuple with the specified type at the head.
If you declare Cons<A, [B, C]>
you will get back [A, B, C]
.
type Cons<X, Y extends readonly any[]> = ((arg: X, ...rest: Y) => any) extends (...args: infer U) => any ? U : never;
Constructs a new tuple with the specified type at the head.
If you declare Cons<A, [B, C]>
you will get back [A, B, C]
.