Skip to main content

--description--

You can easily increment or add one to a variable with the ++ operator.

i++;

is the equivalent of

i = i + 1;

Note: The entire line becomes i++;, eliminating the need for the equal sign.

--instructions--

Change the code to use the ++ operator on myVar.

--hints--

myVar should equal 88.

assert(myVar === 88);

You should not use the assignment operator.

assert(
/let\s*myVar\s*=\s*87;\s*\/*.*\s*([+]{2}\s*myVar|myVar\s*[+]{2})/.test(__helpers.removeJSComments(code))
);

You should use the ++ operator.

assert(/[+]{2}\s*myVar|myVar\s*[+]{2}/.test(__helpers.removeJSComments(code)));

You should not change code above the specified comment.

assert(/let myVar = 87;/.test(__helpers.removeJSComments(code)));

--seed--

--after-user-code--

(function(z){return 'myVar = ' + z;})(myVar);

--seed-contents--

let myVar = 87;

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

--solutions--

let myVar = 87;
myVar++;