New course! Every coder should learn Generative AI!
Try a free lesson0
What is ++a is a=6
I lose too much point there
5 Answers
+ 11
if a = 6 and you do ++a, a becomes 7. If you can post the entire question, that would be better. There might be a catch somewhere.
+ 11
I'm not good at JS syntax, sorry if I do some mistakes.
e.g.
a = 6;
document.write(++a);
// outputs 7
a = 6;
document.write(a++);
// outputs 6
This is because a++ (post increment) uses value of var first before incrementing. While ++a increment value of var first before using it.
+ 7
++a/--a is pre-increment, it immediately modifies the value of a before using it (if required) in the statement.
a++/a-- is post-increment, it only modifies the value after using it (if required) in the statement.
+ 1
got it 😃😃😃 awesome. no need for Google. thanks for refreshing my memory
0
why about a++