Increment a Number with JavaScript help

Increment a Number with JavaScript help
0.0 0

#1

Tell us what’s happening:

Your code so far


var myVar = 87;

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

Your browser information:

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

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/increment-a-number-with-javascript/


#2

Look carefully at the example given in the challenge. There should be no space between the variable name and the ++ operator. Also, where in the examples do you see a 1 after the ++ used in the code?

Lastly, do not re-declare myVar and assign it a new value (your last line of code). The ++ operator will increment the original myVar variable’s value when you write the correct syntax.