http://www.javatpoint.com/javascript-switch
Who We Are ? JavaTpoint is a Sound Online Tutorial Site that offers Tutorials on a wide variety of Technologies Core Java, Spring, JavaScript , Hibernate, Cloud Computing, Python, AJAX,C , Android etc. We provide Point to Point learning which helps beginners a lot. JavaTpoint provide Tutorials even on sub topic of any Topic. Apart from this. JavaTpoint also provide Interview Questions & Forums.
JavaScript JavaScript is a Client side Programming language. JavaScript is the scripting language on web. JavaScript is used to make pages interactive.JavaScript provides user interactivity JavaScript is a lightweight programming language. It offers dynamic drop- down menus. JavaScript is a Case Sensitive language.
JavaScript Switch Case :The Switch Statement, execute one or more statements when a specified condition’s value matches a label. Switch operator checks the argument against each case and executes the code below the match until it meets the break operator. Decision making are needed when, the program encounters the situation to choose a particular statement among many statements.This type of problem can be handled using switch statement.
Syntax:switch(expression) { case value1: code; break; case value2: code ; default: code if above values are not matched; }
Example:var color = "red": switch(color) { case "yellow": alert("yellow color"); break; case "red": alert("red color"); break; case "blue": alert("blue color"); break; default: alert("no known color specified"); break; }
For complete Tutorial go through our Website link is given below http://www.javatpoint.com/javascript-switch