mercredi 3 novembre 2021

How is a switch statement more efficient than other conditional statements when checking for multiple possible values?

i know that using a switch-case is more efficient than liniking else-if statements when checking multiple possible variable values. But what I dont know is how does it "jump" to the right value so fast. What type of function or protocol does it generally use?

Thanks.

Aucun commentaire:

Enregistrer un commentaire