How can we use comparison operators in switch statements in Javascript? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How can we use comparison operators in switch statements in Javascript?

Thanks for answering.

1st Oct 2017, 1:17 PM
Isair Calhawk
Isair Calhawk - avatar
4 Answers
+ 2
if (Myfriend=CoolCodin){document.write ("Then I don't need enemies");}
1st Oct 2017, 5:10 PM
Isair Calhawk
Isair Calhawk - avatar
+ 1
you can't use comparison operators in a switch statement, that is why it is not used often. why not use an if/else if/else statement.
1st Oct 2017, 5:00 PM
Cool Codin
Cool Codin - avatar
+ 1
cause it takes TOO MUCH TIME!
1st Oct 2017, 5:05 PM
Isair Calhawk
Isair Calhawk - avatar
+ 1
well, thats not my problem 😂😂
1st Oct 2017, 5:06 PM
Cool Codin
Cool Codin - avatar