Skip to content

Instantly share code, notes, and snippets.

@brownsmith
Last active March 2, 2018 10:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brownsmith/33314048fd59aa5670587a1e5b4e4775 to your computer and use it in GitHub Desktop.
Save brownsmith/33314048fd59aa5670587a1e5b4e4775 to your computer and use it in GitHub Desktop.
Arrow functions example
// ES5
var multiply = function(a, b) {
return a * b;
};
// ES6
var multiply = (a, b) => { return a * b };
// even neater
var multiply = (a, b) => a * b;
@brownsmith
Copy link
Author

Single params need no brackets
var func = x => x * x;
concise body syntax, implied "return"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment