fixes
This commit is contained in:
parent
d606fb7181
commit
e52705e012
4 changed files with 8 additions and 9 deletions
|
@ -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';
|
||||
}
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue