> For the complete documentation index, see [llms.txt](https://docs.discorddungeons.me/quest-editor/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.discorddungeons.me/quest-editor/logic-blocks/ternary.md).

# Ternary Block

![Ternary Block](/files/-LNihM_T-98MgtvhvEXD)

The ternary block returns the value of `expr1` if `condition` is `true`, otherwise, it returns the value of `expr2`.

To specify the condition, attach a condition block to the `test` input.

To specify the return value if the condition is true, attach it to the `if true` input.

To specify the return value if the condition is false, attach it to the `if false` input.

## Generated Code

```javascript
condition ? if_true : if_false;
```
