Gets the type of the first element of a readonly tuple T. If the tuple is empty, it returns the default type D (defaults to never).
T
D
never
The readonly tuple type.
The default type to return if T is empty. Defaults to never.
The type of the first element, or D if T is empty.
type H1 = Tuple.Head<[1, 2, 3]>; // 1type H2 = Tuple.Head<[]>; // nevertype H3 = Tuple.Head<[], 'default'>; // 'default' Copy
type H1 = Tuple.Head<[1, 2, 3]>; // 1type H2 = Tuple.Head<[]>; // nevertype H3 = Tuple.Head<[], 'default'>; // 'default'
Gets the type of the first element of a readonly tuple
T. If the tuple is empty, it returns the default typeD(defaults tonever).