I'm don't under stand this code

Tell us what’s happening:

Your code so far


var myVar = 87;

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

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36.

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

It is mean you add the number by 1 and myVar = myVar + 1; and myVar++; is the same.

Hi @MahmuodAbdelhameed :smiley:

myVar = myVar + 1; and myVar++; both are same. It’s telling to increment myVar by 1.
You can refer this link.

Hello @MahmuodAbdelhameed

myVar = 87;

If we declare any variable without using var,let and const it will behave like global variable or we can say myVar has global scope so bascially it will override the value of "var myVar = 87;".

"++" this is an increment operator so myVar++; is equal to myVar = myVar+1;

Now final value of myVar is 88.