Learning new things everyday is part of what makes being a rational human being great. And as developers, it is part of our job to learn new things continuously, whether or not these things are from positive learning experiences.
1. Avoid polluting the global scope
Declaring variables is a lot of fun. Sometimes, you may declare global variables even if you don’t want to. In today’s browsers, the global variables are stored in the
window object. So, since there’s a lot of stuff going on there, you may override default values.
Let’s suppose you have an HTML file which contains a