mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-02-07 00:31:56 +01:00
Merge pull request #372 from qgustavor/patch-1
[livescript/en] Fixed comparisons section
This commit is contained in:
commit
d4c6c8605a
@ -135,11 +135,19 @@ funRE = //
|
||||
3 % 2 # => 1
|
||||
|
||||
|
||||
# Comparisons are mostly the same too, except that `==` and `===` are
|
||||
# inverted.
|
||||
# Comparisons are mostly the same too, except that `==` is the same as
|
||||
# JS's `===`, where JS's `==` in LiveScript is `~=`, and `===` enables
|
||||
# object and array comparisons, and also stricter comparisons:
|
||||
2 == 2 # => true
|
||||
2 == "2" # => false
|
||||
2 === "2" # => true
|
||||
2 ~= "2" # => true
|
||||
2 === "2" # => false
|
||||
|
||||
[1,2,3] == [1,2,3] # => false
|
||||
[1,2,3] === [1,2,3] # => true
|
||||
|
||||
+0 == -0 # => true
|
||||
+0 === -0 # => false
|
||||
|
||||
# Other relational operators include <, <=, > and >=
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user