Answers for "js switch case greater than"

3

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;
}
Posted by: Guest on September-02-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language