BananaMaster

23 - Why break is needed in switch (JS lessons)

If you forgot something — click to go to the lesson.

Task 1.

Create a select with options "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun", a button, and a div. Using switch, display: "Sat" or "Sun" — "weekend", "Mon" or "Fri" — "start or end", others — "workday".

Task 2.

Create a select with options "admin", "moderator", "user", "guest", a button, and a div. Using switch, display: "admin" or "moderator" — "panel", "user" — "dashboard", "guest" — "login".

Task 3.

Create a select with options "png", "jpg", "gif", "mp4", "avi", "mp3", a button, and a div. Using switch, display: "png", "jpg", or "gif" — "image", "mp4" or "avi" — "video", "mp3" — "audio".

Task 4.

Create a select with options "easy", "medium", "hard", "expert", a button, and a div. Using switch, display: "easy" or "medium" — "beginner", "hard" or "expert" — "advanced".

Task 5.

Create an input and a button. If "admin" or "moderator" is entered — log "System control" to the console, if "boss" — "Team control", if "client" or "worker" — "Basic control", otherwise — "Error".

Task 6.

Create a select with options "xs", "sm", "md", "lg", "xl", "2xl", a button, and a div. Using switch, display: "xs" or "sm" — "small", "md" or "lg" — "medium", "xl" or "2xl" — "large".