I have a situation where I have to make a check like this:
if foo == a || foo == b || foo == c {
//do stuff
}
is there any way to chain these operands into something smaller like IDK
foo == a||b||c
Try this:
if [a, b, c].contains(foo) {
//do stuff
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With