Skip to content

Glossary: JavaScript Basics

Global

Also written: global variable, globals

A variable declared at the top level of a file, outside every block, so any function in the file can read it. Globals are best kept for fixed settings such as `FREE_SHIPPING_CENTS`.

Where the book teaches it

Related terms

Scopeconst