Add a greater detailed explanation of the Javascript example that is used. (#23787)

This commit is contained in:
Eric Jae-Min Joo
2018-12-07 03:47:43 -05:00
committed by Manish Giri
parent 2a2598074e
commit 6aa8aeda72

View File

@ -65,14 +65,16 @@ const num = someCondition ? 1 : 2;
**Using** `if...else`:
```javascript
// If x = 5, then z = 7 and q = 42.
// If x is not 5, then z = 19.
// If x is equal to 5, then the condition is TRUE. This results in z being set to 7 and q being set to 42.
// If x does not equal to 5, then the condition is FALSE. This results in z being set to 19.
if (x == 5) {
z = 7;
q = 42
} else {
z = 19;
}
```
**Using** `else if`: