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 Functions, Packing, and Unpacking!
You have completed Functions, Packing, and Unpacking!
Preview
Learn about the difference between global and local 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
Scope refers to the visibility
of parts of our program.
0:00
Not all parts of a program can be
seen by other parts of our program.
0:03
This is really important to remember
when you're thinking about functions.
0:06
The code you write inside of a function
is only accessible inside that function.
0:10
That means if you assign a variable inside
a function, you can't use that variable
0:15
in another part of your program and
expect it to reference the same value.
0:19
This can be a little hard
to grasp without seeing it.
0:23
Let's jump into some code.
0:26
Okay, take a look at my workspace here.
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