firescript
Version:
Firescript language
24 lines (17 loc) • 397 B
Markdown
conditional operator
====================
The conditional (ternary) operator is similar to an if...else construct.
If `condition` is *truthy*, it returns the value of `expression1`, otherwise it returns the value of `expression2`.
Syntax
------
```
[condition] ? [expression1] : [expression2]
```
#### Firescript
```fire
foo ? 'foo' : 'bar'
```
#### Javascript
```js
foo ? 'foo' : 'bar'
```