lundi 4 juin 2018

Best solution to compare multiple integers with function

I just wanted to ask you what's the most efficient solution to do the following comparison:

I am getting a value from my function. For example 6. Now I want to compare that with multiple integers and if it fits(true) otherwise(false). Typical if-statement. Als for now I've used an array but I am pretty sure it's very unnecessary to for each the array all the time to check if the value is in it or not.

Can anyone show me a more accurate way?

Regards

Aucun commentaire:

Enregistrer un commentaire