Chapter 5
Working with Operators, Expressions, and Statements
IN THIS CHAPTER
Reading and coding JavaScript expressions
Changing values with assignment operators
Thinking logically with comparison operators
Doing the math with arithmetic operators
Getting wise to bitwise operators
Putting it together with string operators
“Hello Operator. Can you give me number 9?”
— THE WHITE STRIPES
JavaScript operators, expressions, and statements are the basic building blocks of programs. They help you manipulate and change values, perform math, compare two or more values, and much, much more.
In this chapter, you discover how operators, expressions, and statements do their work and how you can best use them to your advantage.
Express Yourself
An expression is a piece of code that resolves to a value. Expressions can either assign a value to a variable, or they can simply have a value. For example, ...
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