Can a switch statement only compare using "=="? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can a switch statement only compare using "=="?

I noticed that in the tutorial for switch they dont mention it comapring anything except "==".

25th Nov 2017, 8:22 PM
Matthew Tate
Matthew Tate - avatar
2 Answers
+ 2
Thats all it does
25th Nov 2017, 10:42 PM
᠌᠌Brains[Abidemi]
᠌᠌Brains[Abidemi] - avatar
+ 1
Yes. The purpose of a switch statement is for checking equality.
25th Nov 2017, 8:28 PM
Christian Parsons
Christian Parsons - avatar