This commit is contained in:
Ilya Kantor 2019-08-02 13:48:10 +03:00
parent d606fb7181
commit e52705e012
4 changed files with 8 additions and 9 deletions

View file

@ -4,13 +4,14 @@ importance: 5
# Rewrite 'if' into '?'
Rewrite this `if` using the ternary operator `'?'`:
Rewrite this `if` using the conditional operator `'?'`:
```js
let result;
if (a + b < 4) {
result = 'Below';
} else {
result = 'Over';
}
```