Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Callback Functions in JavaScript!
You have completed Callback Functions in JavaScript!
Preview
In this video, we'll convert our function declaration into an anonymous function.
Anonymous Functions
An anonymous function is a function without a name.
function ( ) {
//Do something
}
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
An anonymous function is
a function without a name.
0:00
In the case of a callback an anonymous
function can be written in place or
0:00
in line where the name of
the function would be.
0:05
Let's convert sayHello into
an anonymous function.
0:08
With practice, you can jump these
steps that I'm going to take.
0:12
But for now, I'll show my work.
0:16
First, I can change my sayHello
function from a function
0:19
declaration to a function
expression by adding a variable,
0:23
sayHello, And
deleting the name of the function.
0:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up