Operators

Left shift (<<)

Try the free JavaScript compiler

Moves bits left. Number operands use signed 32-bit values and the low five bits of the shift count. BigInt shift semantics do not impose that 32-bit limit.

Formal Syntax & Structure

javascript syntaxjavascript
left << right

Parameters & Attributes

NameTypeDescription
leftexpressionLeft operand.
rightexpressionRight operand; short-circuiting may skip evaluation where applicable.

Return Value

Number or BigInt

Result of the operation.

Working Example

Example Snippetjavascript
console.log(1 << 32);
JavaScript Reference