Variables
Explore JavaScript variables by learning how to assign values, distinguish between primitive and reference types, and understand type changes during execution. This lesson helps you grasp key concepts about value storage and variable behavior in JavaScript.
We'll cover the following...
As you learned earlier, JavaScript supports objects that can have dynamic properties, and so they can be used to represent compound things.
JavaScript also supports primitive or simple value types that store irreducible values such as numbers, strings, and Boolean flags. In this section, you will learn more about these values and types.
Variable assignment #
To store either simple values or objects, you must assign them to variables:
Here, obj and regExp variables hold object instances (a regular expression is represented by a RegExp ...