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
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 that every good JavaScript coder is fluent in expressions.
This chapter takes you through everything you need to know about expressions. You discover some expression basics and then explore a number of techniques for building powerful expressions using numbers, strings, and Boolean values.
Understanding How Expressions Are Structured
A JavaScript expression takes one or more inputs, such as a bill total and a tip percentage, and combines them in some way — for example, by using multiplication. In expression ...
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