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

Left shift operator (<<)

The << operator shifts bits to the left. For Number it operates on signed 32-bit integers and reduces the shift count modulo 32. BigInt has neither restriction; both operands must have matching numeric 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

Left shift assignment (<<=)

The `<<=` operator shifts a value's bits to the left and assigns the result to the target. The value stored in the target can differ from the shift result. The shift uses 32 bits for `Number` but does not truncate `BigInt` results 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

Less-than-or-equal operator (<=)

The <= operator compares two operands and returns a Boolean when evaluation completes normally. It includes the boundary value, but type conversions and NaN require care.

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

Less-than operator (<)

The < operator checks whether its left operand is smaller than its right operand. It compares numbers or strings, may perform type conversions, and returns true or false when it completes normally.

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

Logical AND operator (&&)

The && operator evaluates its left operand and evaluates the right operand only when the left is truthy. It returns one operand's value, which is not necessarily true or false.

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

Logical AND assignment (&&=)

The &&= operator evaluates the right-hand side and assigns its value only when the target's current value is truthy. Otherwise, it skips both the right-hand side and the write.

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

Logical NOT operator (!)

The ! operator converts its operand to a Boolean and reverses it. It returns true for falsy values and false for truthy values. Double negation, !!, produces a Boolean without reversing its meaning.

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

Logical OR operator ||

The || operator returns its left operand if it is truthy; otherwise, it evaluates and returns its right operand. It short-circuits and does not necessarily return a Boolean.

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

Logical OR assignment (||=)

The ||= operator assigns the right-hand value only when the target's current value is falsy. It short-circuits evaluation and evaluates the target reference only once.

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

Multiplication operator (*)

The * operator computes the product of two values after numeric conversion. It supports Number and BigInt but does not allow mixing those types. Number multiplication requires attention to rounding and NaN.

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

Multiplication assignment (*=)

The *= operator multiplies a variable's or property's current value by the right operand and assigns the computed product. The expression yields that product, which may differ from the value actually stored. The operator 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

Nullish assignment: ??=

The ??= operator assigns only when the target contains null or undefined. It preserves 0, false, and the empty string.

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

??: a fallback only for null and undefined

The ?? operator selects its right operand only when the left one is null or undefined. It preserves valid zero, false, and empty-string values.

Basic · ECMAScript 2020+
JavaScript

?.: optional access and calls

Optional chaining stops access when the checked base is null or undefined. It returns undefined instead of evaluating the remainder of that chain.

Basic · ECMAScript 2020+
JavaScript

Property access

Property access uses a dot or square brackets. Dot notation selects a fixed name, while bracket notation evaluates a property key, for example from a variable's 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

Remainder operator (%)

The % operator computes a remainder for Number or BigInt values. A nonzero result has the dividend's sign, so negative inputs distinguish remainder from nonnegative modulo. Operand types and division by zero need special 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

Remainder assignment (%=)

The %= operator calculates the remainder of the current value divided by the right operand and stores the result in the same target. It supports Number and BigInt; remainder is not the same as always-nonnegative modulo.

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

Signed right shift operator (>>)

The >> operator shifts bits right while preserving the sign. For Number it operates on signed 32-bit integers; for BigInt it does not restrict values to 32 bits. The shift-count rules differ between these 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

Right shift assignment (>>=)

The >>= operator shifts bits right while preserving the sign and writes the result back to its left operand. It supports Number and BigInt, with different rules for numeric width and shift counts.

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

Spread and rest syntax (...)

The `...` notation has two context-dependent roles: spread expands values or properties, while rest collects remaining arguments, elements, or properties. It is not a standalone expression operator. Copies made with this syntax are shallow.

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

===: strict equality

The === operator compares values without converting different types to make them match. It returns a boolean: true or false.

Basic · ECMAScript 2020+
JavaScript

Strict inequality operator (!==)

The !== operator checks whether two values are not strictly equal, without type conversion. It returns a Boolean; when comparing objects, identity matters rather than contents.

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

Subtraction operator (-)

The binary `-` operator subtracts the right operand from the left. It converts operands to numeric values and supports either `Number` or `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

Subtraction assignment (-=)

The -= operator subtracts the right operand from the current value of the left operand and stores the result in the same location. It performs numeric conversion, and the whole expression returns the assigned 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