Long description

Back

The JavaScript code consists of four lines of code. Line 1: StartCommand let EndCommand a b c semicolon. Line 1 is labeled Defines a variable named a b c. An arrow labeled Each line of JavaScript should be terminated with a semicolon points to a b c in line 1.

Line 2: StartCommand let EndCommand foo space equals space 0 semicolon.

An arrow labeled A variable named foo is defined and initialized to 0 points to line 2.

Line 3: foo equals space 4 semicolon. Foo equals space 4 semicolon is labeled Notice that whitespace is unimportant. An arrow labeled foo is assigned the value of 4 points to line 3.

Line 4: foo equals open double quotes hello close double quotes semicolon. Foo in line 4 is labeled foo is assigned the string value of open double quotes hello close double quotes. Hello in line 4 is labeled Notice that a line of JavaScript can span multiple lines.

Back