Skip to content

Glossary: JavaScript Basics

switch

Also written: case

A statement that compares one value against many `case`s and runs the matching one. It's tidier than a long `else if` chain.

Where the book teaches it

Related terms

breakdefaultif / else if / else