August 2018
Intermediate to advanced
272 pages
5h 3m
English
Variables are made to receive values directly or through evaluated expressions compounding values and operators or results of function calls: the value is stored internally and the variable references this storage, and takes its value and its type.
There are two kinds of values:
true, false, NaN, infinity, null, undefined, etc.;NOTE.– The content of a container can be modified, while the address remains unchanged (this is important for understanding the “const” declaration below).
To fetch the value of a variable, it must have been identified in the lexical phase: which means to be “declared”. Often, JavaScript code starts with declaration instructions such as:
var tableauCandidats = [];var n = 0; // … …
We will show why it is highly preferable to write:
const tableauCandidats = [];let n = 0; // … …
Let us look back at the two steps in the interpretation of JavaScript (simplified):