mirror of
https://github.com/Fechin/reference.git
synced 2026-11-20 21:23:11 +03:00
feat: add logical operators
This commit is contained in:
1 parent
0bdf9fe3f3
commit
99d67fa4cb
1 file changed
+18
@@ -133,3 +133,21 @@ print(a >= b) -- false
|
||||
-- less than or equals
|
||||
print(a <= b) -- true
|
||||
```
|
||||
|
||||
### Logical
|
||||
|
||||
```lua
|
||||
-- and
|
||||
false and nil --> false
|
||||
0 and 20 --> 20
|
||||
10 and 20 --> 20
|
||||
|
||||
-- or
|
||||
true or false --> true
|
||||
10 or 0 --> 10
|
||||
12 or 4 --> 12
|
||||
|
||||
-- not
|
||||
not true --> false
|
||||
|
||||
```
|
||||
Reference in new issue
Block a user