DEV Community


Discussion on: I've never become overly convinced that switch statements are that much cleaner than `if else if else if else if else`

kip13 profile image

Pattern matching to the rescue ?

Thread Thread
cescquintero profile image
Francisco Quintero 🇨🇴

Isn't this feature called method overloading ? 🤔

Thread Thread
giovannicodes profile image
Giovanni Cortés

No, because overloading is have same parameters with different types, but in patter matching you can have the same type and number of parameters but differs in the content. For example, here!