you can use &&
operator - second operand expression is executed only if first is true
direction == "right" && slideOffset += $(".range-slide").width()
in my opinion if(conditon) expression
is more readable than condition && expression
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…