Northcentral Technical College Introduction To Programming
10-152-310
Introduction to Programming with JavaScript NTC 10-152-310

Learning Plan 6 Variable Scope

# Variable Scope

#### File: /Learning Plan 6/scope.html

### Where am I?

- Global scope was discussed in the introduction to modularization. It's been around for a long time. A global variable is declared in a JavaScript file outside of any functions. The standard is to put them at the top of the file and not indented.
- Global variables look like this:
- If it's not `Global` it's `local`.
- Local Variables are declared inside of functions and that's where they live:
- A local variable can't be seen from any other function. It has `local scope`.
- Here's what local variables look like:

### A Lab sounds good right about now.

- 6.1 Lab 2