Skip to content

Instantly share code, notes, and snippets.

@brownsmith
Last active Mar 2, 2018
Embed
What would you like to do?
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

brownsmith commented Mar 2, 2018

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