switch (expression) { case value1: // code block 1 break; case value2: // code block 2 break; case value3: // code block 3 break; default: // default code block }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter