# switch and the Conditional Operator

A switch statement matches one value against a list of exact choices, and the conditional operator ? : picks one of two values in a single line, so a long chain of else ifs can say what it means.

![Cheat sheet: switch and the Conditional Operator](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/10/d5d0b68f3a20470e993e3bc0cfe11c3f.webp)

- Category: JavaScript
- Level: Apprentice
- Tags: JavaScript, switch Statement (javascript), Ternary Operator (javascript)
- Updated: November 1, 2026

Source: https://www.ask-codey.com/cheat-sheets/javascript-conditions-switch-and-ternary-cheat-sheet
