+ 2
Whatâs The Problem?
Well Iâm solving the switch problem in JS Course ("Switch statement") But even though my code is 100% Correct, the problem is not solving 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") break; } Can Someone help me and tell me whereâs the Problem? đ
9 Answers
+ 6
i find the problem
there was a missing â}â đ
it was for function đ€Šđ»ââïž
+ 4
Abolfazl Abbaspour Your code isn't 100% correct if you aren't passing the tests. You also don't have to send a photo. You can copy and paste the task description as an answer just like you did with your code.
+ 2
Hi
Well, I don't have the pro subscription, so I can't see what they are asking for on the problem
Could you tell us what you are supposed to do?
+ 2
Bruhhđ
0
i canât send you photoâs of the code
can i have your instagram iD or Telegram iD?
to send it?
0
The user can choose the color theme for the browser:
1. Light
2. Dark
3. Nocturne
4. Terminal
5. Indigo
You are given a program that takes
the number as input. Complete the program so that it will output to the console the theme according to input number.
Sample Input
2
Sample Output
Dark
0
this is the description
i even saw the solution, itâs identical to my code
0
solution
function main() {
var themeNumber = parseInt(readLine(), 10)
/*
1 - Light
2 - Dark
3 - Nocturne
4 - Terminal
5 - Indigo
*/
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")
break;
}
0
Well, I mean, does it console.log the solution? Or it doesn't console.log at all? Because you can be passing a string as an argument instead of a number. Because your code looks if themeNumber is an number or not a string