Increment and decrement operator in Javascript:
Increment operator (++): It is used to add one value to existing value, java script supports 2 types of increment operator.
Post increment: a++;
Pre increment: ++a;
Decrement operator (–): It is used to subtract the one value from existing value.
Example: post decrement: a–=a-1=10-1=9
pre decrement: –a=1-a=1-10=|-9|=9
Increment and decrement operator

No comments:
Post a Comment