how can i do it it a bit hard

Tell us what’s happening:
Describe your issue in detail here.

Your code so far


var myVar = 11;

// Only change code below this line
myVar = myVar - 1;
var myVar = 10; 
myVar--; 
myVar = 10;
var my = myVar--;

Your browser information:

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

Challenge: Decrement a Number with JavaScript

Link to the challenge:

HI @Hussein.dev !

Welcome to the forum!

I would reset the lesson.

Your answer should only be one line of code.

Take a look at the example again.

i--;

Hope that helps!

1 Like

You are re-assigning the value of myVar on most lines, . Try removing any lines which re-initialise myVar (var myVar =) or introduce a new variable (var my =) . Look at the example (i–) again and see if you can make it apply it to your variable. I would recommend testing just one line of code at a time to see what works.

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