Testing

Tell your non-tech friend What 'scope' is, and how it works in JavaScript.

In JavaScript, objects and functions are also variables.

Scope is the set of variables, objects, and functions you have access to.

In JavaScript, the scope changes whether a variable is declaired inside a function, or not.

If declaired outside of a function, a variable has a 'global' scope, and is available for use throughout the program.

However, if a variable is declaired inside a function, then that variable is available for use only within that function. It is said to have a 'local' scope.