you can use the or operator (||)
# suitescript
b
you can use the or operator (||)
a
can you give me an example? 🙂
a
if(currAccount == 233 || 603)
like this?
b
that evaluate to true
operator precedence means that what you wrote is the same as (currAccount == 233) || (603))
603 is always truthy, so your expression is the same as true
a
how do I say that If the account is either those two internal ID's
a
currAccount == 233 || currAccount == 603
a
so it's not possible to use an IN statement?
like in saved search
a
that's the latter approach battk referred to
a
how would I word it if I want to make the statement shorter
🙂
a
accountArray.indexOf(currAccount) == -1 // for false
t
let acc = {‘233’true,’603’true} if (acc[currentAccount]){ }
Phone code :-)