3 ms·
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 we
by jdlshore 3y ago
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.
- twelve40 3y agowould a linter help here though? it seems to be a perfectly valid call here, except doing something unintended.
- dragonwriter 3y agoA 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.