+ 3
Me again....i dont understand the switch statements in javascript
3 Respuestas
+ 5
Kevin Kiarie Check it out following article that will help you
https://medium.com/@leeinjae/switch-472d55cf3cbe
Hope this code helps you Switch statement is same in other languages check this code if you still got confused you can ask me again
https://code.sololearn.com/Wn8yUaU8FIAT/?ref=app
+ 3
Hi Kevin Kiarie
I am not a Javascript expert, but Switch works like this.
Usually in a code you will have a variable which needs to be inspected / compared.
You could write a whole heap of if /else statements to check your variable against the comparision.
Or you could write a Switch statement which neatly captures all the comparisons into a simple block of code.
The cases within the Switch statement are compared to the Switch variable.
The code associated to the case will be enabled if the case is true
+ 3
I noticed that you have not done the Javascript tutorial here. Doing it will help you.