Arrow functinos are a new syntax for functions in JavaScript. Here are a few examples:
let f = (a, b) => {
let c = 4;
return a + b - c;
};
let g = x => x * x;
Due to their brevity, arrow functions make writing functions easier and more readable. However, it sould be noted that arrow functions are not just a syntactical sugar, they have important differences with norrmal functions. The most important difference is that they don't have a this binding separate from the outer scope. This makes them very useful, for example, for using with array functions, such as forEach, etc. Also, they don't have an arguments binding. To remedy this, you can use the rest parameter syntax (...rest).