Operators

Bitwise and assignment (&=)

Try the free JavaScript compiler

Keeps bits present in both operands, storing the result. Number operands are converted to signed 32-bit values; BigInt operands use arbitrary-length signed bits.

Formal Syntax & Structure

javascript syntaxjavascript
target &= value

Parameters & Attributes

NameTypeDescription
targetassignment targetWritable binding or property; evaluated once.
valueexpressionRight operand used by the underlying operation.

Return Value

operation result

The value written to the target.

Working Example

Example Snippetjavascript
let n = 7;console.log(n &= 3);
JavaScript Reference