Closed hyeyoonS closed 2 months ago
type First<T extends unknown[]> = T extends [] ? never : T[0]
type First<T extends any[]> = T extends [] ? never : T[0]
type First<T extends any[]> = T extends [unknown, ...any] ? T[0] : never
type First<T extends any[]> = T extends [infer First, ...any] ? First : never
type First<T extends unknown[]> = T extends [infer First, ...any] ? First : never
type First<T extends any[]> = T["length"] extends 0 ? never : T[0]
First of Array
![#array](https://img.shields.io/badge/-%23array-999)
๋ฐฐ์ด(ํํ)
T
๋ฅผ ๋ฐ์ ์ฒซ ์์์ ํ์ ์ ๋ฐํํ๋ ์ ๋ค๋ฆญFirst<T>
๋ฅผ ๊ตฌํํ์ธ์.์์:
๊ด๋ จ๋ ๋ฌธ์ ๋ค