Tell us what’s happening:
I tried both below codes but none is working for me.
++myVar;
myVar= ++myVar;
one is giving 88 value but can’t pass the test.
I am receiving below reply
myVar = myVar + 1; should be changed
Tell us what’s happening:
I tried both below codes but none is working for me.
++myVar;
myVar= ++myVar;
one is giving 88 value but can’t pass the test.
I am receiving below reply
myVar = myVar + 1; should be changed
please share the link to the lesson so that i can see
I just passed both tests but test passed without space in myVar++; but console log is giving an syntax error with this . please see below link
Subtle difference between ++myVar and myVar++
Read up on prefix and postfix
That probably works but wasn’t what the test was looking for. You don’t have to assign back to the variable when you increment. It is incremented in place.