Member-only story
ES6 Arrow Functions and Parameters in JavaScript

Function Expressions
A function expression describes when a function is stored inside a variable. We can declare a named function expression where the function has a name but usually a function expression does not have a name so we refer to this as an anonymous function. Anonymous functions are especially useful when we only want to pass the function as an argument to another function. The reason behind why this is possible is because functions are objects in JavaScript. When you invoke or call a function expression you use the variable name not the function name. When you use a function expression the JavaScript interpreter will not do anything with the function until it gets to the line where the function is initialised. Let’s look at an example of a couple of function expressions.
const myFavouriteGame = function(game) {
return `My favourite game is: ${game}.`
};myFavouriteGame("Monopoly");
//Returns ---> 'My favourite game is: Monopoly.'
The above example declares a variable called myFavouriteGame which is initialised with an anonymous function. The function takes the parameter game. Inside the function body, using a template literal, a string with the value of game is returned.