twhite96
3/18/2017 - 11:46 PM

Arrow Functions One Argument

Arrow Functions One Argument

const square = function(x) {
   return x * x;
}

// One argument and one line of code you can remove the parens, the return statement, and curly braces

const square = x => x * x;

const cube = (x) => {
    return square(x) * x;
}