Operators

Logical and (&&)

Try the free JavaScript compiler

Returns the first falsy operand or the evaluated right operand when the left is truthy. The right expression is skipped when the left is falsy.

Formal Syntax & Structure

javascript syntaxjavascript
left && right

Parameters & Attributes

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

Return Value

operand value

Result of the operation.

Working Example

Example Snippetjavascript
console.log(0 && 9);
JavaScript Reference