You can easily decrement or decrease a variable by 1 with the -- operator.
1
--
i--;
is the equivalent of
i = i - 1;
Note: The entire line becomes i--;, eliminating the need for the equal sign.
There was an error while loading. Please reload this page.
New to Free Code Camp?
JS Concepts
JS Language Reference
Other Links