16
rated 0 times
[
19]
[
3]
/ answers: 1 / hits: 92474
/ 12 Years ago, thu, july 19, 2012, 12:00:00
So I'm using a shorthand JavaScript if
/else
statement (I read somewhere they're called Ternary statements?)
this.dragHandle.hasClass('handle-low') ? direction = "left" : direction = "right"
This works great, but what if later I want to use just a shorthand if
, without the else
portion. Like:
direction == "right" ? slideOffset += $(".range-slide").width()
Is this possible at all?
More From » if-statement