> For the complete documentation index, see [llms.txt](https://creatorlabs.gitbook.io/boltui-docs-preview/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://creatorlabs.gitbook.io/boltui-docs-preview/api-reference/index/when.md).

# When

### Definition

```javascript
function When(condition: Boolean, if_true: any, if_false: any) {
    return any
}
```

### Input

* `condition` : the boolean condition which is to be checked
* `if_true` : the value to be returned when the condition is true
* `if_false` : the value to be returned when the condition is false

### Returns any

This will return the statement which is true according to the given condition
