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? Function declarations and function statements We have (at least) three ways of creating functions in JavaScript. The first is the function declaration. This binds a function to a given name. It looks something like this:1 1 I’ve used String.toLowercase() here, partly for b