Switch Statements
Learn another way of handling multiple possible conditions.
What you should understand
Read the lesson carefully, study the example, then use the editor below to experiment with the code yourself.
let day = 2;
switch (day) {
case 1:
console.log('Monday');
break;
case 2:
console.log('Tuesday');
break;
default:
console.log('Another day');
}
Output
See what your code produces.
Test your understanding
Choose the best answer.
Which structure is used to store multiple values?