0

I want to display True or False in result in my code. I do this code. Thanks you.

True or False. https://code.sololearn.com/WOLvO0IjUo0x/?ref=app

7th Dec 2020, 6:35 AM
Malick Diagne
Malick Diagne - avatar
2 odpowiedzi
+ 3
The following works although it is far more code than necessary: switch (myvotes) { case true: console.log (myvotes ); case false: console.log (myvotes ); } If you just want to print "true" or "false" to the console and myvotes has a boolean value, replace that big switch statement with just: console.log(myvotes);
7th Dec 2020, 7:40 AM
Josh Greig
Josh Greig - avatar
+ 2
Malick Diagne Why aren't you using "true & false" situation?
7th Dec 2020, 7:45 AM
Piyush
Piyush - avatar