increase variable by one javascript code example
Example 1: decrement operator in javascript
// Decrement
let b = 1;
b--; //post decrement
--b; // pre decrement
Example 2: javascript increment
x = 0;
//pre-increment
++x;
//post-increment
x++;
// Decrement
let b = 1;
b--; //post decrement
--b; // pre decrement
x = 0;
//pre-increment
++x;
//post-increment
x++;