---
title: "Discussion on \"[type-challenges] First of Array / Length of Tuple / Exclude\" | Hashnode"
description: "Discussion on \"[type-challenges] First of Array / Length of Tuple / Exclude\". First of Array\n설계 의도\n\n빈 배열인 경우는 never 타입 리턴하고, 그 외는 배열의 첫 번째 요소 리턴하도록 구현\n\n코드\ntype First<T extends any[]> = T extends [] ? never : T[0]\n\n/* _____________ Test Cases _____________ */\nimport type { Equal, Expect } from '@type-challenges/utils'\n\ntype cas..."
url: "https://hashnode.com/posts/type-challenges-first-of-array-length-of-tuple-exclude/682d6d5d26bb3b1fee6f04ef"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [\[type-challenges\] First of Array / Length of Tuple / Exclude](https://yarnmi.hashnode.dev/type-challenges-first-of-array-length-of-tuple-exclude?utm_source=hashnode&utm_medium=feed)

First of Array 설계 의도 빈 배열인 경우는 never 타입 리턴하고, 그 외는 배열의 첫 번째 요소 리턴하도록 구현 코드 type First<T extends any\[\]> = T extends \[\] ? never : T\[0\] /\* \_\_\_\_\_\_\_\_\_\_\_\_\_ Test Cases \_\_\_\_\_\_\_\_\_\_\_\_\_ \*/ import type { Equal, Expect } from '@type-challenges/utils' type cas...

May 21, 2025 · 2 min read · yarnmi.hashnode.dev  
Read the article

-   [#type-challenges](https://hashnode.com/tag/type-challenges)

## Written by

[mmyeon](https://hashnode.com/@yarnmi)

@yarnmi

  
[View profile](https://hashnode.com/@yarnmi)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
