Post

@JavaScript I sometimes like old ones for hoisting or inline util functions
English

@JavaScript Arrow functions since it’s neater especially if written on one line. 👨🏼💻
English

@JavaScript I use normal function syntax but for array methods and stuff i use arrow syntax as it looks a lot cleaner
English

@JavaScript I now default to arrow functions instinctively but can’t say I “prefer” one over the other.
English

@JavaScript Lambdas are faster but less readable. It depends!
English

@JavaScript Starting to use them for any instance in which I don’t need to worry about what ‘this’ is bound to.
English

@JavaScript For callbacks, arrow function.
For function declaration, normal function
English

@JavaScript It takes me 5x more time to understand the syntax everytime I try to use that.
Traditional function() is longer but more comfortable
English

@JavaScript I have a habit of using both. Use => arrow functions for callbacks.
English

@JavaScript I learnt the modern before i knew there was a traditional, lol
English

@JavaScript Depends on the circumstance. Anonymous functions use =>. If I want my reader to better understand the purpose of a function, I'll use traditional.
English

@JavaScript Both, because it's required - they aren't equal. One such example of where arrow functions catch me out, is in event listener callbacks. Arrow functions don't bind 'this', which can lead to debugging hell when I forget 😁
English

@JavaScript Though I’m into Functional Programming, I still prefer function(){} 😅
English

@JavaScript Does using one over the other make any difference to the code?
English

@JavaScript I default to the "function" keyword for most things.
Hoisting is helpful for module-level functions. For inline callback functions/closures, I like that the function keyword allows me to give the function a descriptive name.
English

@JavaScript When passing a #JavaScript function as an argument, its better to use the phatarrow syntax. Inside of a class, or global scope, its better for writing an "easy 2 use & understand lexical scope", and for printing better stacktraces to use the C-Style functions.
English

@JavaScript Arrows!! And any copy and pasted code from stackoverflow is getting arrow'd as well
English

@JavaScript Arrow functions and function declarations have slightly different behavior, so it depends on the use case.
English

@JavaScript Mostly fat arrow (=>) functions. The only time I use traditional functions(function()) is when I need the scope of 'this' to be the function itself, instead of global scope. I guess that's a major difference between the two approaches that really sets apart their use cases.
English

@JavaScript Probably quite unpopular but I prefer the traditional function syntax:
function doSomething (x, y) { ... }
I use arrow functions mostly for one liners and some trivial callbacks.
English

@JavaScript I dnt have a preference yet. I’m still fighting for my life learning the material. 🤣
English

@JavaScript Arrow functions all the way
Becuse on this way i have no problem with this anymore😅
English

@JavaScript arrow function all the time ❤️. Even in our product FansZila ( fanszila.com )
English

@JavaScript Mostly arrow functions for callbacks definitely...
English

@JavaScript `function` keyword for everything but one-liners and inline functions (e.g callbacks on array methods, etc). The function keyword is plenty terse and the hoisting behavior is useful.
I'm also positive this is the only correct opinion to have 😁.
English

@JavaScript Yes! Use => when you want to pass the "this" context from caller to function.
No if that function is ever used outside that context.
English

@JavaScript You can’t use arrow functions with hoisting so in those cases I use old school functions
English










