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 create our callback function and a function that will execute our callback.
This video doesn't have any notes.
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
Let's look at some non
callback code as a refresher.
0:00
There's going to be two JavaScript files,
logger.js and callback.js.
0:02
Logger.js is where the non
callback code is, and
0:08
callback.js is where we'll be
programming the callback code.
0:11
Open up the logger.js file, and
0:16
you can see we have a variable
with my name and role.
0:19
We also have a logTeacher function
that takes the teacher, and
0:24
prints out their name and role.
0:29
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