The usual way to define JavaScript functions is using the function declaration or function expression:
// Function declaration
function greet(who) {
return `Hello, ${who}!`;
}
// Function expression
const greetExpression = function(who) {
return `Hello, ${who}!`;
};
But functions can be further improved. Making the syntax shorter (useful for writing short callbacks) and ease the resolving of this
created a new type of functions named arrow functions.
#javascript #arrow function #function