Getting started
This part of the JavaScript course puts a Node.js runtime on the machine and takes a first program through it: the packages on Linux, macOS and Windows, the editor and the REPL, the first file run with node, and the output, the comments and the semicolon rule that shapes it. Variables and the eight types follow, with typeof and the safe integer range, then the operators and the two equality signs, the conditions and the loops. The part ends with functions: a declaration, an arrow, defaults, a rest parameter and a call that returns undefined.
1.1
What JavaScript is and where it runs
the language, the browser against Node.js, the event loop in one paragraph, a first program and a fragment for the browser
Open
1.2
Install Node.js on Linux, macOS and Windows
the package per system, the LTS line, node --version and npm --version, the versions a program reads from process.versions
Open
1.3
The editor, the Node REPL and running a file
the edit-run loop, a REPL session, node file.js, process.argv and __filename
Open
1.4
Your first JavaScript program
hello.js line by line, template literals, the exit status set with process.exitCode
Open
1.5
Output, comments and the semicolon rule
stdout against stderr, what console.log prints, the two comment forms, automatic semicolon insertion
Open
1.6
Variables: const, let, var
const and frozen objects, let and block scope, var and hoisting, the temporal dead zone
Open
1.7
Types: number, string, boolean and the rest
typeof for the eight types, the safe integer range, bigint, strings and conversion, null against undefined, symbols
Open
1.8
Operators and equality
arithmetic and precedence, the plus sign with text, comparison, === against ==, Object.is, || && and ??
Open
1.9
Conditions and loops
if and else, the conditional operator, switch and fallthrough, for, while and for...of, break, continue and labels
Open
1.10
Functions: declaration, arrow, return values
declaration hoisting, arrow functions, default and rest parameters, a call that returns undefined, a function expression in the dead zone
Open