And make for cleaner JavaScript code. — Since programming language is abstract, the best way to understand it is by using an analogy. JavaScript is no exception. Today, I want to explain the concept of switch-case as an alternative to if-else in a possible plain using, of course, an analogy. Case study (pun intended) Imagine that you have an electrical circuit…