What is the diffrent bitwen 'switch' anf 'if' | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 1

What is the diffrent bitwen 'switch' anf 'if'

7th Nov 2017, 9:18 AM
azedine belkhiri
2 Respuestas
+ 8
with switch you can check one variable for multiple values, if simply checks a boolean condition. you csn accomplish a switch behavior with multiple if's chaned to ifelses. But i recommend to use switch instead of multiple ifelses
7th Nov 2017, 9:25 AM
Jeremy
Jeremy - avatar