Fix my code please


#1

when I use this code
var December = prompt(“What’s today?”);
if (December === “24 days until christmas”); {
prompt("Today is " + December); }

else (December === “wrong”); {
prompt("That is " + December); }

I get the error
expected an identifier and instead saw else
can someone fix this


#2

You have too many semicolons in your code

;

after your if conditional remove any semicolons


#3
  • Don’t use actual quotes, use " or '.
  • Don’t put semicolons after if () or else if () or else.
  • else is used for when anything specified by if () or else if() is not the case, you don’t put brackets
    after an else, in your case you should use an else if (), with that one it works.

Here’s your debugged code:

var December = prompt("What’s today?");

if (December === "24 days until christmas") {
  prompt("Today is " + December); 
} else if (December === "wrong")  {
  prompt("That is " + December); 
}