r/webdev • • May 20 '17

ES6 Arrow Functions: Parameters (9 min screencast)

https://scrimba.com/casts/cast-2055
2 Upvotes

1 comment sorted by

2

u/[deleted] May 21 '17 edited May 21 '17

What about not using a method body?

Instead of:

var hey = (name) => { return 'hey, ' + name; }

You can do:

var hey = (name) => 'hey' + name;

Or with the new es6 template literals:

var hey = (name) => `hey ${name}`;

Only works with a single line function, though!