summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAdam Bard <github@adambard.com>2013-10-09 09:21:33 -0700
committerAdam Bard <github@adambard.com>2013-10-09 09:21:33 -0700
commitd4c6c8605a47d9b51c41ef6d0cab7e767fa43048 (patch)
tree102fce5bad81f05cc8862f058575724e187a2710
parentd3bf3aa77f1a371471b81d8cb95a3eba6a701f93 (diff)
parent97d15053e279bd247c7fd627fb857e89752a2384 (diff)
Merge pull request #372 from qgustavor/patch-1
[livescript/en] Fixed comparisons section
-rw-r--r--livescript.html.markdown14
1 files changed, 11 insertions, 3 deletions
diff --git a/livescript.html.markdown b/livescript.html.markdown
index 8e11439b..5fd61f49 100644
--- a/livescript.html.markdown
+++ b/livescript.html.markdown
@@ -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 >=