Arrow function

 In Arrow function don't need name our functions.

    const myFunc = function () {
            const myVar = "shreyash";
            return myVar;
        }
arrow function
const myFunc = () => {
            const myVar = "shreyash";
            return myVar;
        }
Write Arrow function with parameters
just like a regular function you pass arguments into an arrow function 
const newFun = (a) => console.log(a);
If there is only one parameter in the arrow function, the brackets connecting the parameters can be omitted.
const newFun = a => console.log(a);
Set Default Parameters for your functions
        const profile= (name = "shreyash") => "Hello " + name;
        console.log(profile("pappu"));
        console.log(profile());
Hello pappu
Hello shreyash
Use Rest Parameter with function parameters
    ES6 provides rest parameter for function parameter to help us create more flexible functions. you can create function that take a variable number of arguments. These arguments are stored in an array that can be accessed later rom inside the function.
        function howMany(...args) {
            return "You have passed " + args.length + " arguments.";
        }
        console.log(howMany(0, 1, 2));
        console.log(howMany("string", null, [1, 2, 3], {}));
You have passed 3 arguments.
You have passed 4 arguments.