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 Understanding Closures in JavaScript!
You have completed Understanding Closures in JavaScript!
Preview
Global variables can cause JavaScript developers a lot of trouble. This video will introduce you to a common issue that can result when a variable is declared and used on the global scope.
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
JavaScript developer, lifelong learner and
teacher here at Treehouse.
0:00
In this workshop, we're going to be
talking about closures in JavaScript.
0:01
Knowing about closures can help
you be a better developer.
0:05
And they can even help you in job
interviews, where they often come up.
0:09
To understand what closures are,
let's start looking about a problem
0:13
associated with the global
scope in JavaScript.
0:17
To follow along with me,
launch the workspace with this video or
0:20
download the project files.
0:24
Here we have a very simple HTML page,
which displays nothing, but
0:27
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