Special functions and operators
There are a few special ways of writing functions, as well as some special operators that will come in handy. We are talking about arrow functions and the spread and rest operators here. Arrow functions are great for sending functions around as parameters and using shorter notations. The spread and rest operators make our lives easier and are more flexible when sending arguments and working with arrays.
Arrow functions
Arrow functions are a special way of writing functions that can be confusing at first. Their use looks like this:
(param1, param2) => body of the function;
Or for no parameters:
() => body of the function;
Or for one parameter (no parentheses are needed here):
param => body of the function;
Or for a multiline function with two parameters:
(param1, param2) => {
// line 1;
// any number of lines;
};
Arrow functions are useful whenever you want to write an implementation on the...