Chapter 2Programming Basics
In the last chapter, we introduced JavaScript and set up a programming environment where we got our hands dirty with a few JavaScript programs. In this chapter, we’re going to delve further to learn how JavaScript works, and start writing some programs.
We’ll cover the following topics:
-
the importance of well-commented code
-
JavaScript grammar―expressions, statements, semicolons, and whitespace
-
primitive data types
-
strings―string literals and string methods such as length
-
variables―declaring and assigning
-
numbers―decimal, hexadecimal, octal and exponent form, Infinity, and NaN
-
arithmetic operations such as +, -, *, /, and %
-
undefined and null
-
Booleans―truthy and falsy values
-
logical operators―AND, OR, and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access