coding style - Switch statement fall-through...should it be allowed? - Stack Overflow

PHOTO EMBED

Tue Nov 15 2022 01:00:40 GMT+0000 (Coordinated Universal Time)

Saved by @leawoliu #javascript

switch (value)
{
  case 0:
    result = ZERO_DIGIT;
    break;

  case 1:
  case 3:
  case 5:
  case 7:
  case 9:
     result = ODD_DIGIT;
     break;

  case 2:
  case 4:
  case 6:
  case 8:
     result = EVEN_DIGIT;
     break;
}
content_copyCOPY

https://stackoverflow.com/questions/188461/switch-statement-fall-through-should-it-be-allowed