Chapter 3
Building Expressions
IN THIS CHAPTER
Understanding what expressions are
Figuring out numeric expressions
Tying up string expressions
Getting the hang of comparison expressions
Learning about logical expressions
You might not think that programmers are artists, but programming is an extremely creative profession. It’s logic-based creativity.
—JOHN ROMERO
A surprising amount of JavaScript coding involves making little calculations: Add 5 to this number; multiply these two items together; is the value of variable A greater than the value of variable B?; given a collection of Boolean values, is at least one of them true?
These examples are all English-language equivalents of a JavaScript feature known as the expression. When coding in JavaScript, you use expressions constantly, so it's vital to understand what they are and to get comfortable with the types of expressions that are available to you. Every JavaScript coder is different, but I can say without fear of contradiction ...
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