DEV Community

Discussion on: Using a single for each loop or map to go over multiple arrays

Collapse
 
bfuller123 profile image
Brett Fuller

Great point! Arrow functions are important to JS because of scope related to this keyword and how an arrow function does not have its own this. A common pattern in old JS was that = this but you can forgo that now in favor of an arrow function, and it will actually just use this of the method that called/created it. So when a person gets stuck with using a callback, an arrow function can be their best friend.

Collapse
 
deathshadow60 profile image
deathshadow60

"stuck using a callback" to me just sounds like crappy coding practices -- admittedly that happens a lot with these derpy frameworks created by people unqualified to write a single blasted line of HTML, CSS, or JS... but that's why I don't use or advocate the use of frameworks.

... and the "this" scoping thing has rarely ever been a problem for me, but that stems from understanding it and using different approaches to problem solving than the hot and trendy crap that so many know-nothings blindly copy from those derpy frameworks or web-rot filled hives of scum and villainy like DynamicDrive.

I'd probably be ok with arrow functions if they weren't the "arrow" part and used, I don't know... a WORD. C syntax is painfully and agonizingly cryptic enough without pissing on it further.

But again, I come from a Pascal/Modula/Ada background. C is not my favorite programming language, and with JavaScript using C's painfully obtuse and cryptic syntax...