---
title: "arrayLit(): typeshade/core/ir의 IR 빌더 함수, TypeShade 컴파일러 API"
description: "arrayLit, typeshade/core/ir의 IR 빌더 함수입니다. 고정 길이 배열 리터럴, array<elemKey, N>(...)입니다."
url: https://typeshade.dev/ko/api/arraylit/
language: ko
---

# `arrayLit()`

함수, 값 분류

고정 길이 배열 리터럴, `array<elemKey, N>`(...)입니다.

`import { arrayLit } from 'typeshade/core/ir'`

설명은 커밋 af54ddad5의 검토된 컴파일러 문서를 번역한 것입니다. 시그니처와 예제 코드는 원문을 따르며, 필요한 경우 설명에 편집상 수정이 반영됩니다.

## 구문

```ts
const arrayLit: <E extends ShaderType, const I extends readonly ReadonlyNode[]>(
  elem: E,
  ...items: I,
) => Node<`array<${KeyOf<E>},${I["length"]}>`>
```

## 매개변수

**`elem` `E extends ShaderType`**

**`...items` `I extends readonly ReadonlyNode[]`**

## 반환값

``Node<`array<${KeyOf<E>},${I['length']}>`>``

## 설명

결과 키에 원소 키와 원소 수가 들어갑니다. 그래서 `arrayLit(f32T, a, b, c)`는 `Node<'array<f32,3>'>`이며, 이는 [`typeKey`](https://typeshade.dev/ko/api/typekey/)가 그 런타임 타입에 대해 만드는 키와 같습니다.

## 함께 보기

- [`typeKey`](https://typeshade.dev/ko/api/typekey/)

## 소스

[`src/core/ir/node.ts`, 2474행](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/node.ts#L2474), 커밋 af54ddad5 기준
