diff options
author | Gustavo Rodrigues <qgustavor@gmail.com> | 2013-10-01 09:10:27 -0300 |
---|---|---|
committer | Gustavo Rodrigues <qgustavor@gmail.com> | 2013-10-01 09:10:27 -0300 |
commit | 97d15053e279bd247c7fd627fb857e89752a2384 (patch) | |
tree | 2c6d2e0a4fc09548ee491d2e33ccceb4ab2fe1db /livescript.html.markdown | |
parent | 42a2263ab1b2d911f6865975e518da91a3b73e0b (diff) |
Fixed comparisons section
It was a mistake with `===` operator: `~=` is the equivalent for `==`, not `===` that is a more useful^([citation needed]) version of JS's `===`.
Diffstat (limited to 'livescript.html.markdown')
-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 >= |