Expressions and Operators Reference

Expressions in JavaScript evaluate to produce values. Operators used with them perform operations that return values. For example, using the addition operator (+), the expression x + y returns the sum of the numbers. Note that some expressions do not use operators; we'll cover this later in the course. This section presents a list of operators used in the JavaScript language. We will not use all of them in this introductory course. However, this is a great interactive reference, and you can run the examples. Pay special attention to the relational operators because you will use them in Unit 4.

Primary expressions

Basic keywords and general expressions in JavaScript.  Please select a keyword to learn about the syntax and run an example.

this

The this keyword refers to a special property of an execution context.

function

The function keyword defines a function expression.

class

The class keyword defines a class expression.

function*

The function*keyword defines a generator function expression.

yield

Pause and resume a generator function.

yield*

Delegate to another generator function or iterable object.

async function

The async function defines an async function expression.

await

Pause and resume an async function and wait for the promise's resolution/rejection.

[]

Array initializer/literal syntax.

{}

Object initializer/literal syntax.

/ab+c/i

Regular expression literal syntax.

( )

Grouping operator.