Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It tells you up front what you would otherwise have to go line by line to find out.

There's a similar argument to be made for using forEach/ map / reduce / filter instead of a for loop. Each of those iterative methods has slightly different semantic intent. The only thing the for loop adds to the mix, and therefore the only reason to use them, is the availability of continue / break.

Hell, the same argument could be made for while loops vs for loops. What does a for loop really add that you couldn't get with a while loop?

As for your last point, I don't know of any linter that complains about the use of let when you reassign it. The ones I've used only complain if you use let when const would have worked identically in your code.

The fact that people write bad code is not down to let/const or linters. People always have and always will write crap and not understand why.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: