08.05 · Switch statements / Practice · 4 min
Give Sunday its shared case
Saturday works, but Sunday misses its category. Let two labels share the same response.
Activity 5 of 7 in Switch statements
JavaScript Basics / 08.05
Give Sunday its shared case
Not started
Group both weekend days before one response.

Match a delivery method with switch
Work through 3 focused steps. Read the explanation, type each requested change and check it before moving on. Your own code carries forward.
The mini-lesson opens in a new tab. Your own code carries forward; each step has a focused check and an optional hint.
Start mini-lesson(opens in a new tab)3 steps · Saved work · Instant feedback
YOUR TURN
Give Sunday its shared case
Print Weekday for Monday through Friday, Weekend for Saturday or Sunday, and Unknown day otherwise. Keep the grouped case structure. Add Sunday to the shared weekend group so the starting Sunday input prints Weekend.
Weekend
Keep the starting inputs. Print these lines in this order, without extra output.
Edit JavaScript, then run it. Check Challenge shows which output checks pass or need a fix. Word wrap is enabled.
Ready to checkRun the checks to see your results here.
Your check results
Work in VS Code instead
Copy the starter into a file named practice.js in VS Code. If Node.js is installed, open the terminal in that folder and run node practice.js. Compare the output with the task above. Automated challenge checks are available in the browser editor.
const day = "Sunday";
switch (day) {
case "Monday":
case "Tuesday":
case "Wednesday":
case "Thursday":
case "Friday":
console.log("Weekday");
break;
case "Saturday":
console.log("Weekend");
break;
default:
console.log("Unknown day");
}Need a nudge?
One response can serve several labels
The weekday labels already lead to one block. The weekend can use that same pattern.
Add a label before the existing response
Put case "Sunday": beside case "Saturday":, before the Weekend log. Keep the break after their shared response.
Reveal a possible solution
const day = "Sunday";
switch (day) {
case "Monday":
case "Tuesday":
case "Wednesday":
case "Thursday":
case "Friday":
console.log("Weekday");
break;
case "Saturday":
case "Sunday":
console.log("Weekend");
break;
default:
console.log("Unknown day");
}Try Saturday, Monday and Funday: Weekend, Weekday, Unknown day. Case matching is case-sensitive; sunday is not Sunday. Sharing empty case labels is deliberate fall-through. Leaving out a needed break after a response is a different issue.
Ready to try it?
Practice in your browser and see your results.
Progress details
Have a question?
Ask the Code Zone community.
Ask a question in The Code Zone (opens in a new tab)Continue learning

7 days freeTry The Code Zone
THE CODE ZONE COMMUNITY
Your next step is easier together.
Try the community free for 7 days.
No charge during your trial. Choose your plan on Skool.
- Ask questions and get support in the community
- Watch every course video walkthrough
- Find a study buddy in the 24/7 study room
Make the most of your trial with Premium.
Choose Premium on Skool to try Thursday live help sessions. Bring your questions, work through code, and get unstuck together.
Scheduled Thursdays in Eastern Time. Check the Skool calendar for your local date and time.
Have a website account? Sign in