You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d65d375
Browse filesBrowse the repository at this point in the historyBrowse files
There is also an `else` clause that will be applied every time the first condition isn’t true. This is very powerful if you want to react to any value, but single out one in particular for special treatment:
4
+
5
+
```javascript
6
+
var umbrellaMandatory;
7
+
8
+
if(country ==='England'){
9
+
umbrellaMandatory =true;
10
+
} else {
11
+
umbrellaMandatory =false;
12
+
}
13
+
```
14
+
15
+
The `else` clause can be join with another `if`, lets remake the example from the previous article:
16
+
17
+
```javascript
18
+
if(country ==='England') {
19
+
...
20
+
} elseif(country ==='France') {
21
+
...
22
+
} elseif(country ==='Germany') {
23
+
...
24
+
}
25
+
```
26
+
27
+
28
+
---
29
+
30
+
Fill up the value of `name` to validate the `else` condition.
0 commit comments