Last of Array 中級 #array

by Anthony Fu @antfu

挑戦する    English 简体中文 한국어

> この課題ではTypeScript 4.0が推奨されます 配列 `T` を受け取り、その最後の要素の型を返す汎用的な `Last` を実装してください。 例えば ```ts type arr1 = ['a', 'b', 'c'] type arr2 = [3, 2, 1] type tail1 = Last // expected to be 'c' type tail2 = Last // expected to be 1 ```
戻る 解答を共有 解答を確認

関連する課題

14・First of Array 16・Pop