JavaScript – Subtraction (-)
JavaScript Subtraction (-) Arithmetic Operator is used to perform arithmetic subtraction operation between two numbers, and return the result.
Subtraction Operator Symbol
The symbol used for Subtraction Operator is -
.
ADVERTISEMENT
Syntax
The syntax to use Subtraction Operator with operands is
operand1 - operand2
Examples
In the following example, we take two numeric values and find their difference using Subtraction (-) Operator.
index.html
In the following example, we take two numeric values in exponential notation and find their difference using Subtraction (-) Operator.
index.html
Conclusion
In this JavaScript Tutorial, we learned about Arithmetic Subtraction Operator, its syntax, and usage with examples.