Setting Variables Using Switch Statements In JavaScript
Here is a snippet showing an example of how this would be done. Each animal has a favorite color which we will determine using a switch statement.
const animal = "dog";
const color = (()=>{
switch (animal) {
case "cat":
retur...
blog.kyleschwartz.ca2 min read