// Only change code below this line

Why my solution is not working?

var myVar = 11;
// Only change code below this line
myVar –

and when I test it, it shows that I changed the code above the line and I don’t know why https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/decrement-a-number-with-javascript

You have a couple of issues here.

First, you changed the code above the comment - you removed the blank line.

Next, a decrement needs two hyphens, not one.

Next, that appears to not be a hyphen but is an en dash - it needs to be a hyphen.

When I fix those, the code passes for me.

Remember that you can always start fresh with Reset All Code.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.