# Switch Statements in JavaScript | kirupa.com

**URL:** https://forum.kirupa.com/t/switch-statements-in-javascript-kirupa-com/352604
**Category:** programming
**Created:** [November 23, 2014, 9:55am UTC](https://forum.kirupa.com/t/switch-statements-in-javascript-kirupa-com/352604 "2014-11-23T09:55:16Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)
#### Post date: [November 23, 2014, 9:55am UTC](https://forum.kirupa.com/t/switch-statements-in-javascript-kirupa-com/352604/1 "2014-11-23T09:55:17Z")

</div>

by [kirupa](http://www.kirupa.com/me/index.htm) | 6 January 2013

In a world filled with beautiful if, else, and else if statements, the need for yet another way of dealing with conditionals may seem unnecessary. People with longer beards than you and me disagreed, so we have what are known as switch statements. In this short tutorial, I will describe how to use switch statements and why, putting my initial snarkastic comments aside, they can provide some value.

* * *
This is a companion discussion topic for the original entry at [http://www.kirupa.com/html5/switch\_statements\_javascript.htm](http://www.kirupa.com/html5/switch_statements_javascript.htm)
