1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00
jashkenas--coffeescript/test/test_compound_assignment.coffee

26 lines
259 B
CoffeeScript

num = 10
num -= 5
eq num, 5
num *= 10
eq num, 50
num /= 10
eq num, 5
num %= 3
eq num, 2
val = false
val ||= 'value'
val ||= 'eulav'
eq val, 'value'
val &&= 'rehto'
val &&= 'other'
eq val, 'other'
val = null
val ?= 'value'
val ?= 'eulav'
eq val, 'value'