Incrementing ++ and Decrementing --

PHOTO EMBED

Tue Nov 02 2021 15:16:35 GMT+0000 (Coordinated Universal Time)

Saved by @bronxrock

/*
The ++ operator increments the stored number by 1. If the ++ operator comes after the variable (e.g., counter++), the variable's value is returned first and then incremented:
*/

let counter = 0;
//=> undefined

counter++;
//=> 0

counter;
//=> 1

/*If the ++ operator comes before the variable (e.g., ++counter), the variable's value is incremented first and then returned:*/

let counter = 0;
//=> undefined

++counter;
//=> 1

counter;
//=> 1
content_copyCOPY

https://learning.flatironschool.com/courses/4608/assignments/149882?module_item_id