Increment a Number with JavaScript idk

Tell us what’s happening:
well I already put down myVar++; but I’m not sure where I did wrong because they system kept on telling me that the answer isn’t 88.

Your code so far


var myVar = 87;

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

Your browser information:

User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14092.57.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.85 Safari/537.36

Challenge: Increment a Number with JavaScript

Link to the challenge:

it’s not, it’s 89
consider what this line is doing

1 Like

You should add this console.log(myVar) at the end of your code.

It is also best to use console.log to help debug code. :grinning:

I’m confused why is it 89?

what is doing the line I quoted?

ohhh me me try it real quick

It might actually help to run this code and see what appears in the console.
Then you might have a better understanding of what @ilenia is trying to point out to you.


var myVar = 87;

// Only change code below this line
myVar = myVar + 1;
console.log(myVar)
myVar++; 
console.log(myVar)
1 Like

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