+ 4
Alright, did you ever change your tv channel with the remote? Or how do you change them? You place up the remote in front of the tv and click a button, don't you? This is the idea behind switch statement. You are 'switching' to the remote and hence the channel is being changed according to the corresponding button. For example, let's say you click '1' in your tv remote. So certainly, you'll see the first channel. You 'switched' to the remote clicking 1 and so the first channel appears which is our 'case'! Hope that makes sense!
29th Apr 2020, 4:40 PM
Arb Rahim Badsa
Arb Rahim Badsa - avatar
+ 3
It is like a chain of if-else statements
29th Apr 2020, 3:53 PM
Gordon
Gordon - avatar
0
in programming context "switch" is a "keyword", not a "tag"... "tag" apply rather to descriptive language context (Html, Xml, Svg) and are keyword in angular braces (ie: <tag>)...
30th Apr 2020, 1:21 AM
visph
visph - avatar