The whole "avoid using var" BS is even shown to be malarkey by your example! This whole "block scoping" idiocy is leading to bloated, broken, hard to follow code!

As evidenced by your own example; its' bad enough JavaScript lets you declare variables where-ever the *** you want in the code, without encouraging people to re-use the same name inside a flipping loop?

Reusing the index variable that way iz yousa wents full Gungan. Meesa says yew nevah goes FULL Gungan. How the blazes does that IMPROVE code clarity or make anything better? If makes it more confusing. At least having it misbehave if you do something stupid like that might encourage people to not try and slop the same variable name in there doing different things in the SAME part of the code!

I've been programming for 40 years and that's special right there. In the same way some Olympics are "special".

Talk about solutions in search of a problem, where you have to write card stacked inept junk to make it look good. Junk like conventional for doing for/of's job with a variable for nothing mixed in for bad measure.

Same for the == vs. === idiocy. A LOT of times you want that loose compare because we have loose types. It's like the know nothings who flip out over the loose compare state of an assignment. IF you can't keep track of the difference between =, ==, and === much less where they're appropriate, maybe you should just go flip burgers for a living!

Seriously, so much of this article REEKS of "I'm too stupid to use things properly, so nobody else should be allowed to use any of it"... which right now seems to be the driving force in what's "hot and trendy" and it's causing severe "complexity mismatches" in people's code!

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