0
The switch statement (Dark theme) question
Can someone kindly tell me whatâs wrong with my code var themeNumber = 2; switch(themeNumber){ case 1: console.log("Light") break; case 2: console.log("Dark") break; case 3: console.log("Nocturne") break; case 4: console.log("Terminal") break; case 5: console.log("Indigo") }
5 RĂ©ponses
+ 6
Rukundo Elvis ,
if the code you have shown here is for solving a code coach exercise and if it is your complete code there are 2 other issues:
âȘïžmain function is missing
âȘïžinput is missing, you just used a fixed value
both of these thing are given as a basic code when you are starting to solve the task.
+ 3
I don't see any error?
However, I would recommend you to insert the ; at the line endings and add the "break" in case 5. Maybe you would also like to make use of the default case?
+ 2
Can you please link your complete code the way it is now?
I just did the task and it worked for me...
0
Lothar even when all that is included it still says that test cases 1, 3, 4 are wrong.
0
Lisa iâve done all that and it doesnt seem to work