EXAMRADAR

Question: What will be the result of the following `switch` statement? <pre> <code>var day = "Wednesday";</code> <code>switch (day) {</code> <code>case "Monday".console.log("It's the start of the week.");</code> <code>break;</code> <code>case "Friday".console.log("It's the end of the week.");</code> <code>break;</code> <code>default.console.log("It's a regular day.");</code> <code>}</code> </pre>

Answer:

Since the `day` variable does not match any case, the `default` case will be executed, logging "It's a regular day."

MCQ: What will be the result of the following `switch` statement? <pre> <code>var day = "Wednesday";</code> <code>switch (day) {</code> <code>case "Monday".console.log("It's the start of the week.");</code> <code>break;</code> <code>case "Friday".console.log("It's the end of the week.");</code> <code>break;</code> <code>default.console.log("It's a regular day.");</code> <code>}</code> </pre>

Correct Answer: A. "It's the start of the week." will be logged

Explanation:

Since the `day` variable does not match any case, the `default` case will be executed, logging "It's a regular day."

Discuss a Question

Related Questions

You may be interested in:

Web Fundamental MCQs

Recently Added Articles

How Image to Text Conversion Make Printed Study Materials Easier to Use?

Last updated on: October 23, 2026Posted by: ExamRadar

7 Best Online Exam Makers for Teachers, Schools, and Businesses

Last updated on: October 21, 2026Posted by: ExamRadar

How to pick a Bintan resort when you’ve only got 48 hours

Last updated on: September 23, 2026Posted by: ExamRadar

Features to Look for While Choosing the Best Automation Tool

Last updated on: July 15, 2026Posted by: ExamRadar

AI vs Machine Learning: Key Differences Every Professional Should Know

Last updated on: February 13, 2026Posted by: ExamRadar

Office Cleaning Services That Elevate Sydney Offices

Last updated on: February 11, 2026Posted by: ExamRadar