Mark As Completed Discussion

Other than the basic operators, JavaScript also has some language-specific operators. Two of these are increment (denoted by ++) and decrement (denoted by --) operators. The increment operator increases the value of the number by 1, and the decrement operator decreases the value of the number by 1. However, the order of this operator is important. If the increment or decrement operator is placed before the variable name, it is known as the pre-increment or pre-decrement operator and the increment or decrement in value occurs before returning it. If the increment or decrement operator is placed after the variable name, it is known as the post-increment or post-decrement operator and the increment or decrement in value occurs after returning it.

Let's see some examples.

JAVASCRIPT
OUTPUT
:001 > Cmd/Ctrl-Enter to run, Cmd/Ctrl-/ to comment