16 lines
176 B
Markdown
16 lines
176 B
Markdown
importance: 5
|
|
|
|
---
|
|
|
|
# Rewrite 'if' into '?'
|
|
|
|
Rewrite this `if` using the ternary operator `'?'`:
|
|
|
|
```js
|
|
if (a + b < 4) {
|
|
result = 'Below';
|
|
} else {
|
|
result = 'Over';
|
|
}
|
|
```
|
|
|