mercredi 2 décembre 2020

How to reduce number of characters needed in an IF statement OR operator? [duplicate]

Is there a way to reduce the need to use the same variable over and over in an if statement operator?

For example:

if(value == 10 || value == 11 || value == 12)

Is there a way to do something like (pseudocode), without having to type the variable over and over?

if(value == (10 || 11 || 12))

Thanks for any input.. It's not a question that is easily searchable.

Aucun commentaire:

Enregistrer un commentaire