Skip to content

Commit 6ceac26

Browse files
authored
JE-52908 Comparison and Logical Operators added
1 parent f06d1d6 commit 6ceac26

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

docs/creating-manifest/conditions-and-iterations.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,47 @@
11
# Control Flows: Conditions and Iterations
22

3+
**Comparison** and **Logical** operators are used in *conditional* statements and serve to test for `ture` or `false`.
4+
5+
## Comparison Operators
6+
7+
The Comparison operators are used in logical statements to determine equality or difference between variables or values.
8+
9+
Let's assume that `x = 5`. The table below explains the comparison operators:
10+
11+
| Operator | Description | Comparing | Returns |
12+
|--------------------|-------------------------------------|-----------|----------|
13+
| == | equal to | x == 8 | false |
14+
| == | equal to | x == 5 | true |
15+
| == | equal to | x == "5" | true |
16+
| | | | |
17+
| === | equal value and equal type | x === 5 | true |
18+
| === | equal value and equal type | x === "5" | false |
19+
| | | | |
20+
| != | not equal | x != 8 | true |
21+
| | | | |
22+
| !== | not equal value or not equal type | x !== 5 | false |
23+
| !== | not equal value or not equal type | x !== "5" | true |
24+
| !== | not equal value or not equal type | x !== 8 | true |
25+
| | | | |
26+
| > | grater than | x > 8 | false |
27+
| < | less than | x < 8 | true |
28+
| >= | grater than or equal to | x >= 8 | false |
29+
| <= | less than or equal to | x <= 8 | true |
30+
31+
## Logical Operators
32+
33+
The logical operators are used to determine the logic between variables or values. Let's take that `x = 6` and `y = 3`. The table below explains the logical operators:
34+
35+
| Operator | Description | Example |
36+
|--------------------|-------------------------------------|------------------------------|
37+
| && | and | (x < 10 && y > 1) is true |
38+
| == | or | (x == 5 || y == 5) is false |
39+
| == | not | !(x == y) is true |
40+
41+
42+
43+
44+
345
## Conditions
446

547
The main conditional statement is <b>*if*</b>. Within this parameter, all the available <a href="../placeholders/" target="_blank">placeholders</a> and their objective JavaScript mappings can be used.

0 commit comments

Comments
 (0)