Availability: |
| ||||||||
Property/method value type: | Number primitive | ||||||||
JavaScript syntax: | - | ++anOperand | |||||||
- | anOperand++ | ||||||||
Argument list: | anOperand | A numeric value that can be incremented |
The operand is incremented by one.
A prefixing incrementor will add 1 to the operand value before it is used in an expression.
A post-fixing incrementor will add 1 to the operand after it is used in an 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 |
Included JavaScript files | Up | Infinity |
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. |