Arrow Functions and Default Arguments in ES6
In ES6 there were two major additions regarding functions: (Fat) Arrow Functions( () => {} ) and default arguments( doSmth(arg = 1) ). Fat Arrow Functions allow you to use a shorter syntax to create functions: const fn = (arg1, arg2) => return arg1 + arg2 You may leave out the parenthesis around the arguments if only one argument is passed. If no argument is passed, empty parentheses are required. The function body may be written inline and without curly braces if you’re only writing a return statement (return then also may be left out)....