Expressions and Operators Reference
Site: | Saylor Academy |
Course: | PRDV401: Introduction to JavaScript I |
Book: | Expressions and Operators Reference |
Printed by: | Guest user |
Date: | Friday, 23 May 2025, 8:20 AM |
Description
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.
Expressions and operators
This chapter documents all the JavaScript language operators, expressions and keywords.
Source: Mozilla, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
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.