The JavaScript Switch Statement

Introduction

Something I am trying to get in the habit of using when I do not need complicated if-else statements are switch statements. Switch statements are great for comparing multiple options such as in the case of checking if a string matches a certain word or number. One example that comes to mind is a card game. You can check if your value is equal to a “J”, “K”, etc., and depending on the…