May 09, 2021 CoffeeScript
If you want to know if a variable is within a given range.
Compare syntax using CoffeeScript's embellishments.
maxDwarfism = 147
minAcromegaly = 213
height = 180
normalHeight = maxDwarfism < height < minAcromegaly
# => true
This is a great feature to draw from Python. With this feature, you don't have to write a complete comparison like this:
normalHeight = height > maxDwarfism && height < minAcromegaly
CoffeeScript is more intuitive by supporting two comparisons, like a comparison expression in writing math.