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 DOM Scripting By Example Adding and Removing Names RSVP Checkbox

"(e) =>" not work with me !

when i use "(e) =>" not work , i must always use function(e), could you please say , Why?

3 Answers

Kevin Korte
Kevin Korte
28,149 Points

Are you using babel? If you're trying to do this in a browser, they they can't understand (e) =>, however if you're using babel, it will compile ES2015 into browser-compatible JS (i.e. it'll spit out function(e)) which the browsers can read.

Thank you :)

Steven Parker
Steven Parker
231,269 Points

Arrow functions can't always be substituted for conventional functions. For example, they can't be used as constructors, and they don't provide several of the bindings conventional functions do (most notably "this").

For more details see this MDN page on Arrow Functions.

If that's not the issue, please show more of your code or make a snapshot of your workspace and post the link to it here.

Thank you :)