Created
March 18, 2017 23:46
-
-
Save twhite96/a019b42192599e43ebddbc608ad4df37 to your computer and use it in GitHub Desktop.
Arrow Functions One Argument
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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