Hi, Switch and if condition is same but the big difference is that when a computer comes to an if condition statement..it goes through all the condition to give results, giving to a waste of time but switch statement doesn’t make a computer waste time in decision-making process cuz it doesn’t go through all of it but goes straight to the point at which it’s true.
Question and answer is powered by AnsPress.io