Stuff you might didn't know about CoffeeScript
1–4 of 4 posts
Re: Stuff you might didn't know about CoffeeScript
#2 a = 10
b = 5 > a > 30
When I thought about it after seeing what it compiles to: var a, b;
a = 10;
b = (5 > a && a > 30);
I couldn't see how that statement could be true because a cannot be less than 5 while also be greater than 30.Range checking I would assume would be:
b = 5 30Re: Stuff you might didn't know about CoffeeScript
#3I found the following example to be extremely confusing: a = 10 b = 5 > a > 30 When I thought about it after seeing what it compiles to: var a, b; a = 10; b = (5 > a && a > 30); I couldn't see how that statement could be true because a cannot be less than 5 while also be greater than 30. Range checking I would assume would be: b = 5 30
The range check would be "`5` is less than `a` and `a` is less than `30`". Meaning that `a` is between 5 and 30.
It's fixed now. Thanks martin-adams!
Re: Stuff you might didn't know about CoffeeScript
#4I found the following example to be extremely confusing: a = 10 b = 5 > a > 30 When I thought about it after seeing what it compiles to: var a, b; a = 10; b = (5 > a && a > 30); I couldn't see how that statement could be true because a cannot be less than 5 while also be greater than 30. Range checking I would assume would be: b = 5 30
You are absolutely right! The range check would be "`5` is less than `a` and `a` is less than `30`". Meaning that `a` is between 5 and 30. It's fixed now. Thanks martin-adams!