News for hackers. Stuff that matters.
Re:A Modern JavaScript Tutorial by wa1987 on Monday December 07, 2020 @02:04PM (#25335787)
> - for in loop - for of loop

It's 2020 and you still use loops? ;-)

source: https://github.com/buildo/eslint-plugin-no-loops

Re:A Modern JavaScript Tutorial by graup on Monday December 07, 2020 @07:40PM (#25339921)
Disallowing for..of iterators is the reason I cannot use or recommend the Airbnb lint preset. A very nice example of an anno 2014-2017 cargo cult that clearly hasn't held up. https://github.com/airbnb/javascript/issues/1271
Re:A Modern JavaScript Tutorial by BigJono on Monday December 07, 2020 @10:02PM (#25341195)
Don't worry, there's plenty of 2020 cargo culting to replace it.
Re:A Modern JavaScript Tutorial by hombre_fatal on Monday December 07, 2020 @03:45PM (#25337240)
for/of is an iterator. It consumes the Symbol.iterator interface and is totally different from the for(i++) statement.

That eslint rule is a good example of a cargo cult. The second link in its rationalization argues for using underscore over touching a dangerous loop yourself.