MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/webdev/comments/6cb0q3/es6_arrow_functions_parameters_9_min_screencast/
r/webdev • u/mrborgen86 • May 20 '17
1 comment sorted by
2
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!
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!