Variable problem

what else should i add which assignment operator should I change

Your code so far


var myVar = 87;

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

Your browser information:

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

Challenge: Increment a Number with JavaScript

Link to the challenge:

This line does not change myVar.

you should do myVar = myVar + 1 to work

i use

myVar++

you can you any one myVar = myVar +1 or myVar++ both works the same

ok thanks i will just continue using the one am using

Hi,
you can also have this options as well, with pure vanilla js

var myVar = 87;
// you can use this option for short hand code.
myVar+=1; // witch is the same as myVar = myVar + 1;
console.log(myVar);

// or even this option as well
// Having the ++ infront of the variable.
++myVar; 
console.log(myVar);

:smiley:ok thanks i will try that