The ++ is responsible of the increment of the number value by 1 . But have you wondered what is the difference between putting it before or after?
++a : returns the value after the increment.
a++ : returns the value before the increment.
Let's take an example:
let a=0;
a++;
++a;
the output will be:
output->0
1
Top comments (1)
Hi Yns, This is a feature of many languages that derive their implementation from C.
I think a better example would be: