The book almost exclusively uses arrow functions for defining functions. The only exceptions are when we write generator functions, which must use the standard function's syntax. If you’re not familiar with arrow functions, they look like this, which defines a single-argument function named inc:
const inc = arg => arg + 1;
They can appear on one line or broken into two:
const inc = arg => arg + 1;
Functions that have more than one argument have the arguments wrapped in brackets:
const add = (a, b) => a+ b;
If a function has multiple statements, then the body is wrapped in curly braces and the return keyword is used to denote when the function returns: