Chapter 5. JavaScript Structures

CONTENTS>>

As seen in Chapter 4, “Using Operators and 4,” operators are the building blocks of expressions. In some respects, expressions are the building blocks of statements; however, expressions themselves can be statements, so it would be tautological to say that expressions build statements.

A better way to understand statements can be found in the three basic structures in JavaScript and just about every other programming language. The three structures are as follows:

  • Sequences

  • Branches

  • Loops (iterative)

All statements in JavaScript fall into one of those structural categories, ...

Get JavaScript Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.