Skip to content

Latest commit

 

History

History
16 lines (10 loc) · 1.82 KB

File metadata and controls

16 lines (10 loc) · 1.82 KB

First of Array easy #array

by Anthony Fu @antfu

Take the Challenge    简体中文 日本語

Implement a generic First<T> that takes an Array T and returns it's first element's type.

For example

type arr1 = ['a', 'b', 'c']
type arr2 = [3, 2, 1]

type head1 = First<arr1> // expected to be 'a'
type head2 = First<arr2> // expected to be 3

Back Share your Solutions Check out Solutions

Related Challenges

15・Last of Array