Lesson Planet
Search educational resources
  • Sign In Try It Free
  • AI Teacher Tools
    • Discover Resources Search reviewed educational resources by keyword, subject, grade, type, and more
    • Curriculum Manager (My Content) Manage saved and uploaded resources and folders To Access the Curriculum Manager Sign In or Join Now
    • Browse Resource Directory Browse educational resources by subject and topic
    • Curriculum Calendar Explore curriculum resources by date
    • Lesson Planning Articles Timely and inspiring teaching ideas that you can apply in your classroom
    • Our Story
    • Frequently Asked Questions
    • Testimonials
    • Contact Us
  • Pricing
  • School Access
    • Your school or district can sign up for Lesson Planet — with no cost to teachers
      Learn More
  • Sign In
  • Try It Free

Hi, what do you want to do?

Create a lesson plan
Create a lesson plan
Generate resources with 80+ AI teacher tools
Generate resources with 80+ AI teacher tools
Search 200,000 instructional videos
Search 200,000 instructional videos
Find a teaching resource
Find a teaching resource
Local and Global Variables, Computer Programming Instructional VideoLocal and Global Variables, Computer Programming Instructional Video
Publisher
Khan Academy
Resource Details
Curator Rating
Educator Rating
Not yet Rated
Grade
6th - Higher Ed
Subjects
STEM
1 more...
Resource Type
Instructional Videos
Media Length
5:06
Audiences
For Teacher Use
1 more...
Duration
10 mins
Instructional Strategies
Flipped Classroom
1 more...
Accessibility
Closed Captions
Year
2014
Usage Permissions
Creative Commons
BY-NC-SA: 3.0
cc
Instructional Video

Local and Global Variables, Computer Programming

Curated and Reviewed by Lesson Planet
This Local and Global Variables, Computer Programming instructional video also includes:
  • JavaScript Guide
  • Local and Global Variables, Computer Programming (HTML version from khanacademy.org)
  • Join to access all included materials

This video explains the difference between local and global variables in JavaScript programming without getting into the nitty gritty of variable lifetimes. Using a small coding example with a function defined, the author shows how a range of code exists where you have access to local variables and how that differs from variables defined globally.

3 Views 3 Downloads

Concepts

javascript, computer code, Computer Programming, technology resources

Additional Tags

programming in javascript

Classroom Considerations

  • This video is hosted on YouTube

Pros

  • Provides an excellent explanation about an important concept in programming, the scope of a variable 

Cons

  • None

See similar resources:

Instructional Video

Object Methods, Intro to JS: Drawing & Animation, Computer Programming

Khan Academy
This video shows young programmers how to use the same concept to duplicate objects with different properties and attach functions to them. This method allows functions to be easily called with various objects.
5 mins 6th - Higher Ed STEM
Instructional Video

Intro to Variables, Computer Programming

Khan Academy
What are variables, and why do I need them? These are the questions answered in this basic computer programming video. The author stresses the importance of how the equal sign used in math class has a different meaning than the equal...
4 mins 5th - Higher Ed STEM
Instructional Video

Incrementing shortcuts, Computer Programming

Khan Academy
Text messages full of abbreviations can be easier to understand once you know what the letters stand for. The same goes for reading code because computer programmers always devise ways to reduce typing. One typical line of code that...
4 mins 6th - Higher Ed STEM
Instructional Video

Nested For Loops, Computer Programming

Khan Academy
A loop within a loop is called a nested loop. It expands the repeating code based on two different variables. The video shows an example of drawing an image across and down a screen.
6 mins 6th - Higher Ed STEM
Instructional Video

For Loops! A New Kind of Loop, Computer Programming

Khan Academy
Now that you are familiar with while loops let's look at a new type of loop: the for loop. This video shows the three parts of the for loop: the start, the Boolean test, the value change, and how it differs from a while loop.
6 mins 6th - Higher Ed STEM
Instructional Video

Modifying Arrays, Computer Programming

Khan Academy
An instructional video combines arrays, loops, and mouse clicks. The author shows how to modify JavaScript code to add a balloon each time the mouse is clicked. The video also shows two different ways to add to the end of the array: one...
6 mins 6th - Higher Ed STEM
Interactive

Challenge: Double Rainbow

Khan Academy
Draw a rainbow over the rainbow. The second segment in a series of six has the class practice using functions to edit a program that draws a rainbow. After creating the function, the interactive lesson challenges pupils to create another...
6th - Higher Ed STEM
Interactive

Challenge: Parting Clouds

Khan Academy
Let the sun shine as your young coders move the clouds across the sky while practicing animation coding skills in JavaScript. Younger learners may benefit from more guided help or a whole-class discussion before trying this coding...
6th - Higher Ed STEM
Interactive

Project: Magic 8-Ball

Khan Academy
Your student programmers will enjoy creating their own Magic 8-ball in this JavaScript activity. This a great opportunity to practice using if and else statements based on randomly generated numbers. What will you ask the 8-ball? 
6th - Higher Ed STEM
Instructional Video

Intro to Coloring

Khan Academy
Programming without color is like watching the Wizard of Oz in black and white, you understand what's going on, but you lose the visual impact of the story. Here, we learn to add color to the images we are coding. Background,...
4 mins 5th - Higher Ed STEM
Try It Free
© 1999-2026 Learning Explorer, Inc.
Teacher Lesson Plans, Worksheets and Resources

Sign up for the Lesson Planet Monthly Newsletter

Open Educational Resources (OER)

  • Health
  • Language Arts
  • Languages
  • Math
  • Physical Education
  • Science
  • Social Studies
  • Special Education
  • Visual and Performing Arts
View All Lesson Plans

Discover Resources

  • Our Review Process
  • How it Works
  • How to Search
  • Create a Collection

Manage Curriculum

  • Edit a Collection
  • Assign to Students
  • Manage My Content
Contact Us Site Map Privacy Policy Terms of Use