Account
Categories

Subtraction Operator


You use the subtraction operator in a webpage for mathematical calculation. It helps in subtracting two values (numbers), which are also called operands, and together with the minus sign (-), they perform the subtraction.

Syntax:
let result = left_operand - right_operand;
Example:
let a = 20;
let b = 10;
let sub = a - b;
console.log("The subtraction is: " + sub);
Output: