dimanche 22 avril 2018

How to condense several conditional statement comparing the same value (Ruby)

Now sure how else to word that;

I want to know if there is a way to condense this line of code:

elsif i == '+' || i == '-' || i == '/' || i == '*'

Aucun commentaire:

Enregistrer un commentaire