#10 JavaScript Switch Statement | JavaScript for Beginners

preview_player
Показать описание
The switch statement evaluates an expression and executes the corresponding body that matches the expression's result. It is used in decision making.

In this video, we will learn about the switch statement and how to use it to make decision making programs in JavaScript. We will also learn to create a calculator using the JavaScript switch statement.It is going to be an interesting video, do watch it till the end.

~

Timestamps:
00:18 Switch Statement
04:11 Omitting break
05:05 JavaScript switch With Multiple Case
06:50 Simple Calculator
8:41 Programming Task
9:10 Programiz Quiz

Find Programiz elsewhere:

---------------------------------------------------

#10 JavaScript Switch Statement | JavaScript for Beginners

#javascript #switch #programiz #learnprogramming #js #coding
Рекомендации по теме
Комментарии
Автор

🚀Loved the JS tutorial? Take it further with Programiz PRO!
Refine your skills and build confidence with interactive lessons, quizzes, and challenges. Strengthen your programming foundation and master JavaScript today!

programizstudios
Автор

thank you sir .for giving well teaching.please continue on javascript cls

monikahj
Автор

Sir node js 2022 me shikh sakte hai scope hai plz reply

ms-zbyh
Автор

Q. Which of the cases is executed in the following code?

let value = 4;

switch(value) {
case 1:
case 2:
default:
}

1. case 1
2. case 2
3. case 4
4. default

programizstudios
Автор

Answer (spoilers)




const month = parseInt(prompt("Enter a number from 1 to 12"));
let result;
switch(month){
case 1:
console.log("January");
break;
case 2:
console.log("February");
break;
case 3:
console.log("March");
break;
case 4:
console.log("April");
break;
case 5:
console.log("May");
break;
case 6:
console.log("June");
break;
case 7:
console.log("July");
break;
case 8:
console.log("August");
break;
case 9:
console.log("September");
break;
case 10:
console.log("October");
break;
case 11:
console.log("November");
break;
case 12:
console.log("December");
break;

default:
console.log("Invalid number");
break;

}

Nopenoway_
visit shbcf.ru