Switch Statements is an actively used design pattern created in 1952. In computer programming languages, a switch statement is a type of selection control mechanism used to allow the value of a variable or expression to change the control flow of program execution via search and map. Switch statements function somewhat similarly to the if statement used in programming languages like C/C++, C#, Visual Basic .NET, Java and exists in most high-level imperative programming languages such as Pascal, Ada, C/C++, C#, Visual Basic .NET, Java, and in many other types of language, using such keywords as switch, case, select or inspect. Switch statements come in two main variants: a structured switch, as in Pascal, which takes exactly one branch, and an unstructured switch, as in C, which functions as a type of goto. Read more on Wikipedia...

67Years Old
  • Switch Statements ranks in the top 25% of entities I track
  • the Switch Statements wikipedia page
  • Switch Statements first appeared in 1952
  • Have a question about Switch Statements not answered here? Email me and let me know how I can help.

Languages with Switch Statements include javascript

Example from javascript:

var animal = "dog"
switch (animal) {
 case "dog": console.log("yay"); break;
 case "cat": console.log("oh"); break;

Last updated August 9th, 2020

Edit Switch Statements on GitHub