//first of array
type FirstResult<T> = T extends [infer first, ...infer Rest] ? first : never;
type arr1 = ['a', 'b', 'c'];
type arr2 = [3, 2, 1];
type head1 = FirstResult<arr1>; // expected to be 'a'
type head2 = FirstResult<arr2>; // expected to be 3