Check if a variable is in an array
Posted: Mon Jul 10, 2017 11:00 pm
Is there a built-in function that simply checks if a value is in an array and returns a boolean? I've looked at all of the Thyme tutorials I could find and I've checked the massive list of Thyme commands & variables sticky. All I want to do is this:
Looking at the lack of support for everything else (we don't even have loop structures), I won't be surprised if there isn't an easy way of doing this.
- Code: Select all
array0 = [1, 2, 3]
var0 = 1
<check if var0 is in array0> ? {
doAThingIfVar0IsInArray0()
} : {
DoAThingIfVar0IsNotInArray0()
}
Looking at the lack of support for everything else (we don't even have loop structures), I won't be surprised if there isn't an easy way of doing this.