Operators

Subtraction operator (-)

Try the free JavaScript compiler

Subtraction converts operands to numeric values and computes the left value minus the right. BigInt operands must both be BigInt; Number arithmetic follows floating-point rules.

Formal Syntax & Structure

javascript syntaxjavascript
left - right

Parameters & Attributes

NameTypeDescription
leftexpressionValue to subtract from.
rightexpressionValue to subtract.

Return Value

number | bigint

Numeric difference.

Working Example

Example Snippetjavascript
console.log(9 - 4);
JavaScript Reference