diff options
author | Adam Bard <github@adambard.com> | 2013-10-09 09:21:33 -0700 |
---|---|---|
committer | Adam Bard <github@adambard.com> | 2013-10-09 09:21:33 -0700 |
commit | d4c6c8605a47d9b51c41ef6d0cab7e767fa43048 (patch) | |
tree | 102fce5bad81f05cc8862f058575724e187a2710 | |
parent | d3bf3aa77f1a371471b81d8cb95a3eba6a701f93 (diff) | |
parent | 97d15053e279bd247c7fd627fb857e89752a2384 (diff) |
Merge pull request #372 from qgustavor/patch-1
[livescript/en] Fixed comparisons section
-rw-r--r-- | livescript.html.markdown | 14 |
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 >= |