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

There are a lot of these poor API design decisions in early JavaScript, which we're stuck with due to the need for backwards compatibility. ("Don't break the web.") Modern JavaScript APIs tend to be pretty good. Fortunately, early JavaScript was also very small, so you mostly memorize the footguns (or use a linter) and you're good. This is one of them.


would a linter help here though? it seems to be a perfectly valid call here, except doing something unintended.


A linter would help, if you have a lint rule that requires a locally defined (regular or arrow) function and not a variable inside of map, filter, etc.




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

Search: