Chapter 5Functions and Variable Scope

Variable Scope and Storage Class

Remember that JavaScript is a programming language, and as such, it shares certain characteristics common to all programming languages. The concepts of variables and functions are two such shared characteristics. A variable is basically a segment of memory set aside to hold data. That memory segment is referenced by a name that you assign, thus allowingyou to put things into it and take them out when you wish.

All JavaScript variables have two attributes:

Scope

Storage class ...

Get Advanced Javascript, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.