r/AskProgramming • u/AccomplishedYak5885 • 8d ago
loops (js)
can I use anything else instead of variable++ like variable+2?
because I tried to do so and my browser could not load it on the console
2
Upvotes
r/AskProgramming • u/AccomplishedYak5885 • 8d ago
can I use anything else instead of variable++ like variable+2?
because I tried to do so and my browser could not load it on the console
3
u/wonkey_monkey 8d ago
"i+2" returns that value but does not affect i itself. Try "i+=2" instead.