JavaScript - Switch statement Switch statement is the alternative of if statement but the syntax would be different. Syntax: switch (key) { case value: break; default: break; }