may be as follows:
item = YourValue; switch (true) { case (item <= 10): money += 25; $('#money').html(money); break; case (item > 10 && item <= 20): money += 50; $('#money').html(money); break; }
Expressions in case statements will be evaluated as true or false, and if this matches the switch condition,
but at my suggestion you should go with if ... else if ... else for this business logic.
Mr. Go source share