---
title: "arrayLit(): IR builder function in typeshade/core/ir"
description: "arrayLit, an IR builder function in typeshade/core/ir. A fixed-length array literal, array<elemKey, N>(...)."
url: https://typeshade.dev/api/arraylit/
language: en
---

# `arrayLit()`

Function in Values

A fixed-length array literal, `array<elemKey, N>`(...).

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

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

## Syntax

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

## Parameters

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

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

## Return value

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

## Description

The result key carries the element key and the item count, so `arrayLit(f32T, a, b, c)` is `Node<'array<f32,3>'>`, the key [`typeKey`](https://typeshade.dev/api/typekey/) produces for its runtime type.

## See also

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

## Source

[`src/core/ir/node.ts`, line 2474](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/node.ts#L2474), at commit af54ddad5
