Availability: |
| ||||||||

Property/method value type: | Number primitive | ||||||||

JavaScript syntax: | - | - anOperand1anOperand2 | |||||||

Argument list: | anOperand1 | A numeric value to be subtracted from | |||||||

anOperand2 | A numeric value to be subtracted |

Subtraction is indicated when two operands are separated by a minus sign.

The value on the right is subtracted from the value on the left. The result is the difference between the two values.

Subtraction behaves identically to addition, as if the formula:

`a - b`

had become:

`a + (-b)`

The associativity is left to right.

Refer to the operator precedence topic for details of execution order.

ECMA 262 edition 2 - section 11.6.2

ECMA 262 edition 2 - section 11.6.3

ECMA 262 edition 3 - section 11.6.2

Prev | Home | Next |

SubmitButton.value | Up | Subtract then assign (-=) |

JavaScript Programmer's Reference, Cliff WoottonWrox Press (www.wrox.com)Join the Wrox JavaScript forum at p2p.wrox.comPlease report problems to support@wrox.com© 2001 Wrox Press. All Rights Reserved. Terms and conditions. |