Update 100-if-else.md (#1821)
* Update 100-if-else.md * Update content/roadmaps/106-javascript/content/107-javascript-control-flow/101-conditional-statements/100-if-else.md Co-authored-by: Kamran Ahmed <kamranahmed.se@gmail.com>pull/1825/head
parent
1c0fd98625
commit
de4ea8a57e
1 changed files with 15 additions and 1 deletions
@ -1 +1,15 @@ |
|||||||
# If else |
# If else |
||||||
|
|
||||||
|
The `if` statement executes a statement if a specified condition is `truthy`. If the condition is `falsy`, another statement in the optional `else` clause will be executed. |
||||||
|
|
||||||
|
``` |
||||||
|
if (condition) { |
||||||
|
statement1 |
||||||
|
} else { |
||||||
|
statement2 |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
<ResourceGroupTitle>Free Content</ResourceGroupTitle> |
||||||
|
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/if...else'>if...else</BadgeLink> |
||||||
|
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://javascript.info/ifelse'>Conditional branching: if, '?'</BadgeLink> |
||||||
|
Loading…
Reference in new issue