+ 5
prefix and postfix
hi everybody, can somebody explain the error in js: Invalid left-hand side expression in prefix operation? Why things like the following don't work: ++(x+2), (++x)++, ++(x++)
5 Respuestas
+ 4
.... :)
It won't be able bc
++ pre/post fix need to point to variable not the value
What I mean?
x+2 or ++x or x++ in that case return the "value" which never point to variable at all
+ 2
Without bracket it's not working too. This ++x++ leads to error.
+ 1
Very_Hard(asm & js & c++ & java & py & (@Hard)),
thank you for the explanation.
0
I think you have to have a variable before/after them. You cannot have a bracket before/after them
0
I also once played with these things. Have a look here:
https://code.sololearn.com/c1zH4HtI9N53/?ref=app