JS Built-ins
ControlFlowadvanced

Control Flow β€” switch: intentional fallthrough

Fallthrough: multiple cases sharing one handler

When you omit break, execution "falls through" to the next case. This is sometimes intentional β€” like grouping weekdays and weekend days.

Challenge: Write getDayType(day) that returns:

  • 'Weekday' for Monday through Friday
  • 'Weekend' for Saturday and Sunday
  • 'Unknown' for anything else

Use fallthrough (empty cases) to group them.

πŸ’‘ Hints (1)
  • β€’ Empty cases with no break fall through to the next case with code