Title:
Variable Scope
Updated:
October 26, 2023
Task/Activity:
  1. Questions
A. Questions
What is a 'local' variable?

A local variable is a variable that is declared within a function.

What is a 'global' variable?

A global variable is a variable that is declared outside of the funtion but in the script element.

If you try to alert a variable that is not visible (not in scope), what will happen to your program?

It appears as 'null', since, as far as the computer is concerned, the variable doesn't exist.