JavaScript switch case Statement | switch Statement in JavaScript - JavaScript Tutorial 36

preview_player
Показать описание
Notes for You:: JavaScript switch case statement
- Browser executes the case whose label matches the expression given in a switch case parenthesis.
- When there are more than one alternative choices, we use switch case statement.

Syntax:
switch(expression){
case label-1:{
statements;
}
break;
case label-2:{
statements;
}
break;

default:{
statements;
}
}

Example Code:

var choice = 1;
switch(choice){
case 1:{
}break;
case 2: {
}break;
case 3:{
}break;
default:{
}break;
}

Output:
Ceiling fan is on

=========================================

Follow the link for next video:
JavaScript Tutorial 37 - How to Trace or Debug JavaScript code in Google chrome

Follow the link for previous video:
JavaScript Tutorial 35 - if else if ladder statement in JavaScript

=========================================

JavaScript Tutorials Playlist:-

=========================================
Watch My Other Useful Tutorials:-

jQuery Tutorials Playlist:-

jQuery UI Tutorials Playlist:-

Bootstrap Tutorials Playlist:-

=========================================

► Subscribe to our YouTube channel:

► Visit our Website:

=========================================
Hash Tags:-
#ChidresTechTutorials #JavaScript #JavaScriptTutorial
Рекомендации по теме
Комментарии
Автор

SUBSCRIBE, SHARE & SUPPORT:
VISIT & LEARN AT FREE OF COST:

ChidresTechTutorials
Автор

Excellent example sir. 25% javascript tutorials successfully completed sir. thanks sir.

vamsikrishna
Автор

Best explanation ive seen Thank u sir.

kaddriistrefi
Автор

What a great teacher your are Sir, very simple to understand, 🙏🏿

chandangautam
Автор

Haha love your house and the explanation!!😆👍🏼 perfect!!

pretzshiva
Автор

Sir your example is good to understand the concept of switch also instead of changing value we can take prompt function it will be more easier to change value during execution

sajidapatel
Автор

Switch statement & Switch case statement bothe are equal or not

dhanimudigonda
Автор

Can u please tell, no one is telling, how to use prompt in switch case

shwetha
Автор

sir i want looping statements video tutorial like for, while,do while.will you please upload that too sir

DurgaPrasad-gkis