2010-01-16 16:37:49 -05:00
|
|
|
# CoffeeScript's operations should be chainable, like Python's.
|
|
|
|
|
2010-01-24 23:40:45 -05:00
|
|
|
print 500 > 50 > 5 > -5
|
2010-01-16 16:37:49 -05:00
|
|
|
|
2010-01-24 23:40:45 -05:00
|
|
|
print true is not false is true is not false
|
2010-01-16 16:37:49 -05:00
|
|
|
|
2010-01-24 23:40:45 -05:00
|
|
|
print 10 < 20 > 10
|
2010-01-16 16:37:49 -05:00
|
|
|
|
2010-01-24 23:40:45 -05:00
|
|
|
print 50 > 10 > 5 is parseInt('5', 10)
|
2010-01-16 22:04:08 -05:00
|
|
|
|
|
|
|
|
|
|
|
# Make sure that each argument is only evaluated once, even if used
|
|
|
|
# more than once.
|
|
|
|
|
|
|
|
i: 0
|
2010-01-26 02:15:08 -05:00
|
|
|
func: => i++
|
2010-01-16 22:04:08 -05:00
|
|
|
|
2010-01-24 23:40:45 -05:00
|
|
|
print 1 > func() < 1
|