Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Getting Started With ES2015 Create Functions Using Arrow Syntax Concise Arrow Function Syntax

is it worth to use arrow function?

In this video, we're removing so much because it's only 1 line of argument. But what if there are cases where you need to edit and add more than 1 line of code again? You'd need to add the brackets back and everything? What's the use for arrow function?

1 Answer

josephweiss2
josephweiss2
7,094 Points

you don't use arrow functions for functions that might be eventually used with more then 1 line of code etc, you can make use of it if its just a sum you need or when even using lots of functions like array.find, array.filter and much more