June 2018
Beginner
288 pages
6h 31m
English
Here are the solutions to the Exercises, for the Chapter 2, Variables and Constants chapter.
The program will not terminate. It will output 0, 1, 2, 0, 1, 2,… forever until you terminate the program out of boredom.
| | 'use strict'; |
| | |
| | function first() { |
| | for(let i = 0; i < 5; i++) { |
| | second(); |
| | } |
| | } |
| | |
| | function second() { |
| | for(let i = 0; i < 3; i++) { |
| | console.log(i); |
| | } |
| | } |
| | |
| | first(); |
Runs the code in struct mode. Detects undeclared variables, errors due to setting read-only properties, and the use of any reserved keywords.
Yes. The const field cannot be changed.
No. Freeze is not deep. Only the top-level object is read-only. The program changes an object at a ...
Read now
Unlock full access