Basic JavaScript - Increment a Number with JavaScript

Tell us what’s happening:
Describe your issue in detail here.
i cant move from this code
Your code so far

let myVar = 87;

// Only change code below this line
myVar = myVar + 1;

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36

Challenge: Basic JavaScript - Increment a Number with JavaScript

Link to the challenge:

my code so far
++myVar;

Suggestion:
You have the right idea. Just have the ++ and myVar reversed, I think.
Try putting the myVar first in the code.

Happy coding! :slight_smile:

i have tried to reverse and this is what its saying
// running tests

myVar

should equal

88

. // tests completed

Odd! Let me check it out. Because it should work if you use the same set up as you had only place the myVar before the ++ rather than ++myVar.
Like this from the lesson
Note: The entire line becomes i++;, eliminating the need for the equal sign.
Notice the i++

thanks :smile: for the help

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.