Boolean Primitives vs. Objects in Javascript
We have come to love and respect the fact that (almost) everything is an object in Javascript and we can use all kinds of variables without giving a damn about their types. But, we also can understand that Javascript is trying to work its magic when we throw all caution to the wind. This may have adverse effects. Consider using Booleans as an example. const truthy = true; const falsy = false; console.log(!!truthy); // true console.log(!!falsy); // false The !! just gives the right boolean value - it is equivalent to the variable being used in an if condition. ...