Decrement a Number with JavaScript Help!

Tell us what’s happening:

Your code so far

var myVar = 11;

// Only change code below this line
i-- = i--;

Correct answer below:
myVar = --myVar;

Link to the challenge:
https://www.freecodecamp.org/challenges/decrement-a-number-with-javascript

As stated: i-- is equivalent to i = i -1. Now for the challenge you will have to decrement myVar. One way would be: myVar = myVar -1, but they want you to use the -- operator.

None of the answers worked for me! :frowning:


As the failing test states, you have to "Use the -- operator on myVar".

Not sure what happened but this is correct answer below:
myVar = --myVar;

I have the same issue, in several tests