---
title: "condExpr(): function in Authoring, TypeShade API reference"
description: "condExpr, a function in Authoring. N-arm value dispatch on conditions, the first true condition winning: condExpr([[c0, () => e0], [c1, () => e1]], () => eN)."
url: https://typeshade.dev/api/condexpr/
language: en
---

# `condExpr()` deprecated

Function in Authoring

N-arm value dispatch on conditions, the first true condition winning: `condExpr`(\[\[c0, () => e0\], \[c1, () => e1\]\], () => eN).

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

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

## Syntax

```ts
function condExpr<K extends string>(
  arms: ReadonlyArray<readonly [ReadonlyNode<'bool'>, () => ReadonlyNode<K>]>,
  elseVal: () => ReadonlyNode<K>,
): Node<K>
```

## Parameters

**`arms` `ReadonlyArray<readonly [ReadonlyNode<'bool'>, () => ReadonlyNode<K>]>`**

**`elseVal` `() => ReadonlyNode<K>`**

## Return value

`Node<K>`

## Source

[`src/core/ir/builder.ts`, line 1783](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/builder.ts#L1783), at commit af54ddad5
