Skip to content

Commit f9574f8

Browse files
committed
add link to topics in conditional logic
1 parent 8921a55 commit f9574f8

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

en/conditional/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,10 @@ First of all, conditions can be used to ensure that your program works, regardle
1414

1515
The other thing conditions can do for you is allow for branching. You might have encountered branching diagrams before, for example when filling out a form. Basically, this refers to executing different “branches” (parts) of code, depending on if the condition is met or not.
1616

17-
In this chapter, we'll learn the basis of conditional logic in JavaScript.
17+
In this chapter, we'll learn the basics of conditional logic in JavaScript, including the following topics:
18+
19+
* [if](./if.md)
20+
* [else](./else.md)
21+
* [switch](./switch.md)
22+
* [comparators](./comparators.md)
23+
* [concatenate](./concatenate.md)

en/conditional/comparators.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,8 @@ In order to avoid the if-else hassle, simple logical comparisons can be utilised
3232
let topper = marks > 85 ? "YES" : "NO";
3333
```
3434

35-
In the above example, `?` is a logical operator. The code says that if the value of marks is greater than 85 i.e. `marks > 85` , then `topper = YES` ; otherwise `topper = NO` . Basically, if the comparison condition proves true, the first argument is accessed and if the comparison condition is false, the second argument is accessed.
35+
In the above example, `?` is a logical operator. The code says that if the value of marks is greater than 85 i.e. `marks > 85` , then `topper = YES` ; otherwise `topper = NO` . Basically, if the comparison condition proves true, the first argument is accessed and if the comparison condition is false, the second argument is accessed. This shorthand operator is also known as the `ternary operator` as it takes three operands.
36+
37+
```javascript
38+
condition ? expression1 : expression2
39+
```

0 commit comments

Comments
 (0)