Skip to content

Commit 5413d5c

Browse files
committed
[add] an example for logical operators.
1 parent 2c64253 commit 5413d5c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

examples/logical.ls

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
var x = true;
22
var y = false;
33

4+
// and is a valid keyword for returning true if both operands are true.
45
if (x and y) {
56
print "x and y are both true";
67
}
78

9+
// or is a valid keyword for returning true if either operand is true.
810
if (x or y) {
911
print "Either x, y, or both are true!";
1012
}

0 commit comments

Comments
 (0)