Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript Interacting with the DOM Responding to Events Functions as Parameters

JOE BELL
JOE BELL
11,032 Points

Not a question. Treehouse, you need to fix the error in the video. from 3:20. .

Not a question. Treehouse, you need to fix the error in the video. from 3:20.

2 Answers

Steven Parker
Steven Parker
218,596 Points

The recommended procedure for reporting a course but to the staff can be found at the top of the Support page If they agree and you are the first to report it, it will get you a "special Exterminator badge". :beetle:

And you might want to be a bit more specific about exactly what the error you found in the video was.

JOE BELL
JOE BELL
11,032 Points

Hi Steven. Thanks for the reply. I didn't know that and now glad you pointed that out. I had tried to report it but with no luck which is why I posted the comment with the hope that a staff member would read and act on it.

Steven Parker
Steven Parker
218,596 Points

I don't know if the staff always reads the forum posts, but they should definitely see anything you email to the support address. Did you explain what the error was? I couldn't see anything wrong in the video myself.

Steven Parker
Steven Parker
218,596 Points

After seeing Pere's note I agree that the video is problematic.

There are two ways of writing anonymous function expressions, but the instructor pauses at the wrong moment to identify it. The first type uses the word "function" and would look like this:

hiAndBye(function () {

The second type is with an arrow function which the instructor eventually creates and looks like this:

hiAndBye(() => {

It's not clear why he would change from one type to the other, but the fact that he pauses midway through the conversion and describes it, and then makes a change to another line before returning and finishing, is most definitely confusing and probably needs at least some explanation in the "Teachers Notes" section.

Pere Brumos
Pere Brumos
3,485 Points

I think that the issue JOE BELL refers to is this piece of code:

hiAndBye(function ()=>{
    console.log("Hello")
})

which is described in 3:25 as an anonymous function. Later on, the teacher deletes function and runs the code, which of course works.

So, it seems to me that JOE BELL wanted to point out this particular moment, where an incorrect way of writing a function (function ()=>) is described also incorrectly as an anonymous function, and finally the actual function written is and executed is an arrow function.