JS- Is there a command to increment or decrement by x? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

JS- Is there a command to increment or decrement by x?

We know ++ increases by 1, but what if I want to increase by .5 or 2.

16th Sep 2021, 5:56 PM
Alex Davis
Alex Davis - avatar
2 Answers
+ 4
i += 5 u can use this to increament a number by 5
16th Sep 2021, 5:59 PM
Pariket Thakur
Pariket Thakur - avatar
+ 1
Thanks I will have to try that.
16th Sep 2021, 6:02 PM
Alex Davis
Alex Davis - avatar