🔍 Search
Sign in to post
Where are arrow functions (=>) widely used in JavaScript?https://www.reddit.com/r/programming/comments/1vwr2ve/where_are_arrow_functions_widely_used_in

I'm learning JavaScript and I'm trying to understand the practical use of arrow functions. I understand the syntax difference between: const add = function(a, b) { return a + b; }; and: const add = (a, b) => a + b; But I'm wondering: are arrow functions basically a modern replacement for normal function expressions, or do they have particular use cases where they are preferred? Where do you commonly use arrow functions in real-world JavaScript? And are there situations where you would specifically choose a normal function expression instead? I'm looking for the reasoning behind when to use ea…

0trust.social media

Loading your media...

Pick a GIF — Giphy

Loading GIFs...