मराठी
महाराष्ट्र राज्य शिक्षण मंडळएचएससी विज्ञान (सामान्य) इयत्ता १२ वी

Explain switch case conditional statement in JavaScript with example.

Advertisements
Advertisements

प्रश्न

Explain switch case conditional statement in JavaScript with example.

थोडक्यात उत्तर
Advertisements

उत्तर

JavaScript has a decision control statement known as switch. The switch statement test the value of given expression against the list of case values and when the match is found a block of statement associated with that case is executed.

Syntax of switch case is:

switch(expression)
{
case x:
//code block
break;
case y:
//code block
break;
default:
//code block
}
shaalaa.com
Switch case and Looping Structures in JavaScript
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 3: Advanced Javascript - Exercises [पृष्ठ ५२]

APPEARS IN

बालभारती Information Technology (Science) [English] Standard 12 Maharashtra State Board
पाठ 3 Advanced Javascript
Exercises | Q 6.3 | पृष्ठ ५२

संबंधित प्रश्‍न

__________ statement is used to jump out of loop.


Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×