Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js switch case greater than

switch (true) {
  case (0 <= val &&  val < 1000): /* do something */ break;
  case (1000 <= val &&  val < 2000): /* do something */ break;
  ...
  case (29000 <= val &&  val < 30000): /* do something */ break;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #switch #case #greater
ADD COMMENT
Topic
Name
7+6 =