Chapter 9. JavaScript Expressions, Operators, Statements, and Arrays

JavaScript is the most commonly used web programming language and is very popular among developers around the world. This chapter will cover most of the expressions, operators, statements, and arrays used in this language.


A valid unit of code required to resolve a value is known as an expression. It is a set of literals, operators, variables, and expressions required to evaluate a value. This value can be a string or any logical value. An expression results in a value that can be written wherever a value is expected. There are two types of expressions:

  • An expression that assigns a value to a variable
  • An expression that has a value

Consider the following example:

var A ...

Get Web Developer's Reference Guide 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.