Skip to content

Instantly share code, notes, and snippets.

@twhite96
Created March 18, 2017 23:46
Show Gist options
  • Save twhite96/a019b42192599e43ebddbc608ad4df37 to your computer and use it in GitHub Desktop.
Save twhite96/a019b42192599e43ebddbc608ad4df37 to your computer and use it in GitHub Desktop.
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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment