how to increment a variable in js code example
Example 1: javascript increment
x = 0;
//pre-increment
++x;
//post-increment
x++;
Example 2: javascript decrement
// Increment
let a = 1;
a++;
++a;
// Decrement
let b = 1;
b--;
--b;
x = 0;
//pre-increment
++x;
//post-increment
x++;
// Increment
let a = 1;
a++;
++a;
// Decrement
let b = 1;
b--;
--b;