So, the difference between prefix and postfix decrement (or increment) operators is when the operation is executed. As you may guess, when the decrement operator is prefixed the returned value will be the result of the decrement operation and when the operator is postfixed the returned value will be the value prior to the operation.
Let’s see it with code:
let a = 0
let b = ++a // now b = 1 and a = 1 because the operator changed the value of a and then it evaluated the expression
let c = b++ // now c = 1 and b = 2 because the operator only changes the value after the expression is evaluated
console.log(a, b, c) // 1, 2, 1