Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / JavaScript

Knowledge base — JavaScript

Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.

Entries: 1003

JavaScript

Assignment operator (=)

The = operator stores an expression's value in a variable or object property and returns the assigned value. It neither compares values nor declares variables.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

await operator — waiting for a result

An await expression suspends the current execution of an async function or module until the awaited value settles. It produces a promise’s fulfillment value or throws its rejection reason without blocking the entire thread.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Bitwise AND (&)

The & operator keeps bits set to 1 in both operands. It is used for masking and testing flags; for Number it operates on signed 32-bit integers, while BigInt results are not limited to 32 bits.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Bitwise AND assignment (&=)

The &= operator computes the bitwise AND of the target’s current value and the right operand, then stores the result in that same target. It is useful for retaining only bits selected by a mask. It supports Number and BigInt, but not a mixture of them.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Bitwise NOT (~)

The unary ~ operator flips the bits of a numeric value. For Number it operates on a signed 32-bit integer; for BigInt it does not restrict the value to 32 bits. It must not be confused with logical NOT (!).

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Bitwise OR operator (|)

The | operator combines the bits of two values: a result bit is 1 when at least one corresponding operand bit is 1. It supports Number and BigInt, but does not allow mixing those types.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Bitwise OR assignment (|=)

The |= operator performs bitwise OR on the target's current value and the right operand, then performs an assignment of the computed result to the target. It can set the bits selected by a mask without clearing the others and supports Number and BigInt.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Bitwise XOR operator (^)

The ^ operator performs bitwise exclusive OR: a result bit is 1 when the corresponding operand bits differ. It supports Number and BigInt, but does not allow those numeric types to be mixed.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Bitwise XOR assignment (^=)

The ^= operator computes the bitwise exclusive OR of the target’s current value and the right operand, then assigns the result to that target. It can toggle bits using a mask and supports Number and BigInt, but does not allow mixing those types.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Comma operator (,)

The comma operator evaluates expressions from left to right and returns the last value. Side effects from earlier expressions are preserved. Do not confuse it with commas separating arguments, array elements, or declarations.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Conditional operator (?:)

The conditional operator `?:` selects one of two values based on a condition. It is an expression: it evaluates the condition and then only the selected branch, whose value becomes the result.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Decrement operator (--)

The -- operator subtracts one and writes the result back to its operand. The x-- form returns the previous numeric value, while --x returns the new value. Both support Number and BigInt.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

delete operator

The delete operator removes an object's own property, not the object itself or a variable. Learn its Boolean result, strict-mode restrictions, and the holes it leaves in arrays.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Division operator (/)

The / operator computes the quotient of two operands. Number division can return a fraction, while BigInt division discards the fractional part toward zero. Mixing these types and dividing a BigInt by zero throw exceptions.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Division assignment (/=)

The /= operator divides the current value of a variable or property by the right operand and stores the result in the same location. It supports Number and BigInt, but does not allow those types to be mixed.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Loose equality operator (==)

The == operator compares values using specified conversion rules when operand types differ. Learn how it differs from ===, how null and undefined are treated, and why objects are compared by identity.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Exponentiation operator **

The ** operator raises a base to a given power. Learn its right associativity, the syntax rules for negative bases, and the differences between Number and BigInt calculations.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Exponentiation assignment (**=)

The **= operator raises a target's current value to a specified power and stores the result in the same location. The target is evaluated only once. It supports Number and BigInt, but does not allow mixing those types.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Greater-than-or-equal operator (>=)

The >= operator checks whether the left operand is greater than or equal to the right operand. Comparison can convert types, so strings, null, and NaN deserve particular attention.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Greater-than operator (>)

The > operator checks whether the left operand is greater than the right operand. It returns a Boolean but may first convert its operands. Two strings are compared lexicographically rather than numerically.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

in operator — checking property existence

The `in` operator checks for a property by key, not by value. For an ordinary object with an ordinary prototype chain, it checks for both own and inherited properties. A `Proxy`'s `has` trap can change the result. The right operand must be an object; a primitive causes `TypeError`.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Increment operator (++)

The ++ operator adds one to a numeric value and attempts to write the result back to its operand. The count++ form returns the previous numeric value, while ++count returns the new value.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Inequality operator (!=)

The != operator tests inequality using comparison rules that allow implicit type conversion. It negates ==, so values of different types do not necessarily produce true. The !== operator does not perform these conversions.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

The instanceof operator

With an ordinary, unbound function on the right, the instanceof operator defaults to checking whether the function’s `prototype` occurs in an object’s prototype chain. It accounts for inheritance, but does not prove how an object was created or that particular fields exist.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support