I need to set value to a
that depends on a condition.
What is the shortest way to do this with CoffeeScript?
E.g. this is how I’d do it in JavaScript:
a = true ? 5 : 10 # => a = 5
a = false ? 5 : 10 # => a = 10
I need to set value to a
that depends on a condition.
What is the shortest way to do this with CoffeeScript?
E.g. this is how I’d do it in JavaScript:
a = true ? 5 : 10 # => a = 5
a = false ? 5 : 10 # => a = 10