/

HTML / CSS / JavaScript Tutorial

JavaScript Operator: minus

[this page | pdf | back links]

In JavaScript, the - operator has two possible meanings:

 

Arithmetic operator (binary)

 

Subtraction, e.g. if x is 8 then y = x - 2 results in y becoming 6

 

Arithmetic operator (unary)

 

Minus sign, e.g. if x is 8 then then -x represents -8

 


NAVIGATION LINKS
Contents | Prev | Next | JavaScript Operators


Desktop view | Switch to Mobile