Conditional operator in Coffeescript

Blub picture Blub · Nov 17, 2011 · Viewed 48.2k times · Source

I really like this:

var value = maxValue > minValue ? minValue : maxValue;

Is there something equally concise in Coffescript?

Answer

Tim Cooper picture Tim Cooper · Nov 17, 2011
value = if maxValue > minValue then minValue else maxValue