The operand is decremented by one.
A pre-fixing decrementor will subtract 1 from the operand value before it is used in the expression.
A post-fixing decrementor will subtract 1 from the operand after it is used in the expression.
Be careful how you use this pre/post placement as you can easily generate 'off by one' errors in your algorithms by placing the operator on the wrong side of the operand.
This operator is more or less functionally equivalent to:
anOperand -= 1
which is equivalent to:
anOperand = anOperand - 1
Prev | Home | Next |
decodeURIComponent() | Up | Deep copying |
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. |