In the beginning when God created the heavens and the earth he also created the HTML language and the JavaScript language soon after.
And God saw that it was good.

Then God said, “Let there be HTML DOM Events”. And it was so.
And God saw that it was good.

And God said, “Let there be DOM Event Listeners”. And it was so.
And God saw that it was good… But unfortunately, so did everyone else….

Even till this day, many programmers still see the “good” in using Event Listeners to build and develop applications. Scattering the logic and state…

Ever since the dawn of programming, most programming languages contain the switch statement.

For those who never heard of the switch statement, it is used to perform a set of actions based on the current value of a given variable (an example will be presented in a second).

In other words, we use the switch statement to select one of many code blocks to be executed.

The main reason for the existence of the switch statement was to avoid if-else structure in certain cases.

For example, let’s create a function that returns the result of a binary operation between two…

Dor Nisim

Software Engineer and MSc graduate. Experienced developer, passionate about teaching and programming. Well organised with a passion for learning new things

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store