Get the latest tech news
What's the difference between named functions and arrow functions in JavaScript?
Arrow functions (also known as ‘rocket’ functions) are concise and convenient. However, they have subtle differences compared to function declarations and function expressions. So how do you know which one to use, and when?
If we compress the function body to one expression, we can drop the curly braces and the return keyword. We can also drop the round braces if the arrow function takes a single argument. We can use what we’ve learned to create a flow chart that will help us determine which function syntax to use.
Or read this on Hacker News