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 Interacting with the DOM Responding to Events Functions as Parameters

please update this course. it is teaching the wrong information and out of date syntax for anonymous/arrow functions

Issue found: https://teamtreehouse.com/library/functions-as-parameters-4#questions this video is so old I spent 10 minutes looking at stack overflow and MDN trying to figure out why i was getting an error writing an anonymous function. he is instructing us to write an anonymous function as: hiAndBye(function ()=>{ console.log("greeting"); }); which is out of date and I was only able to figure out what was wrong after running it through multiple Javascript validators. Please fix this, it brought me loads of unnecessary frustration. I appreciate the amount of content you offer but this is just disappointing to say the least. Thank you

1 Answer

Rohald van Merode
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree seal-36
Rohald van Merode
Treehouse Staff

Hey Elijah Pereira,

This course is actually very up to date since it’s one of the latest courses released. The reason your code isn’t working is because you’re using both the function keyword aswell as an => for an arrow function.

If you remove the function keyword (3:40 in the video) your code should start working as expected

Hope this helps