Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
es6 functions explained...
// method shorthand. ES6 version.
{
initialize() {},
doSomething() {}
}
// replaces (ES5)
{
initialize: function() {},
doSomething: function() {}
}
// arrow functions (bind 'this' properly. No more 'self = this' needed.)
(param1, param2) => {}
// replaces anon functions
function(param1, param2) {}
// because
() => {} === function() {}.bind(this)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.