What’s The Problem? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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? 💙

27th Jun 2022, 12:46 PM
Abolfazl Abbaspour
Abolfazl Abbaspour - avatar
9 Answers
+ 6
i find the problem there was a missing “}” 😂 it was for function 🤦🏻‍♂️
27th Jun 2022, 1:30 PM
Abolfazl Abbaspour
Abolfazl Abbaspour - avatar
+ 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.
27th Jun 2022, 1:07 PM
Justice
Justice - avatar
+ 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?
27th Jun 2022, 12:52 PM
Alexandre
Alexandre - avatar
+ 2
Bruhh😂
27th Jun 2022, 2:09 PM
Alexandre
Alexandre - avatar
0
i can’t send you photo’s of the code can i have your instagram iD or Telegram iD? to send it?
27th Jun 2022, 12:56 PM
Abolfazl Abbaspour
Abolfazl Abbaspour - avatar
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
27th Jun 2022, 1:09 PM
Abolfazl Abbaspour
Abolfazl Abbaspour - avatar
0
this is the description i even saw the solution, it’s identical to my code
27th Jun 2022, 1:11 PM
Abolfazl Abbaspour
Abolfazl Abbaspour - avatar
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; }
27th Jun 2022, 1:17 PM
Abolfazl Abbaspour
Abolfazl Abbaspour - avatar
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
27th Jun 2022, 1:18 PM
Alexandre
Alexandre - avatar