Please Stop Reassigning For No Reason!
I swear it is was a short one but a must write and yes, once again, since I keep seeing this kind of mistake everywhere! This is not about JavaScript, this is about programming whatever language you want ... if you do this, you are doing it wrong! The Problem JS Engines developers are desperate ! They are even posting how to help JIT compilers to go faster and developers seem to be so lazy that even most basic good practices are avoided. Performances a part, this pattern can be also dangerous , specially in this ES5 era where getters and setters are extremely common, specially on mobile browsers where nobody cares about IE gap. I am looking at you only if you are still writing something like this in your code: window.whatever = window.whatever || { /* the whatever it is, object, function, anything */ }; where window is just the generic object example. OMG, What Can Be Wrong ... Everything! Any object property could be a native or user defined setter. In this case above techni...