Basic JavaScript - Increment a Number with JavaScript

Tell us what’s happening:

there is a bug in this lesson. I set ‘myVar = myVar++;’ but i do not get credit.

Your code so far

let myVar = 87;

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

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36

Challenge Information:

Basic JavaScript - Increment a Number with JavaScript

Hi Ryan, welcome to the community.

Please re-read the given example carefully:

i++;

is the equivalent of

i = i + 1;

So, what is the equivalent of

myVar = myVar + 1;

Is it:

or it isn’t?

1 Like