When should I use prefix increment operator (++i)?
When should I use prefix increment operator (++i)?
Sometimes I need to increment the original value first, then return it value. So this operator is exactly what I need.
How it (++i) works?
Let's look at this example:
let i = 2;
let counter = ++i * 2...
script.hashnode.dev1 min read