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 anonymous function into an arrow function.
Arrow Functions
( ) => {
console.log("Hello");
}
( ) => console.log("Good bye");
Checkout this workshop on Arrow Functions for more details and examples.
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
In this video, we'll convert our
anonymous functions into arrow functions.
0:00
Let's pull out this anonymous function
from the executeCallback function.
0:01
This way, we can see the progression
from a regular anonymous function
0:06
to an arrow function.
0:10
To convert a function
into an arrow function,
0:11
simply remove the function keyword.
0:15
And after the parentheses, add an equal
sign and a greater than symbol,
0:17
this is often called a fat arrow.
0:22
Let's reintroduce the callback
into the executeCallback function.
0:25
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