The operand is evaluated and converted to a numeric value. The result is negated.
A positive value becomes negative and a negative value becomes positive.
This is functionally equivalent to:
anOperand *= -1
Which is equivalent to:
anOperand = anOperand * -1
And also:
anOperand = 0 - anOperand
Although this is classified as a unary operator, its functionality is really that of an additive operator.
The associativity is from right to left.
Refer to the Operator Precedence topic for details of execution order.
Prev | Home | Next |
Navigator.userProfile | Up | NES |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |