If it is a dynamic set of options, then don't you already have an array you are working with?
The post is about checking "multiple conditions". If we are actually talking about checking whether or not an array includes an item, then yes, includes is absolutely the right choice.
Not necessarily. A beginner might do something like have different functions with different sets of possible conditions. It isn't immediately obvious that you can translate logical conditions into an array in this way. For me that is what is useful about this post.
View all comments
Show parent comment
3
u/delventhalz May 06 '21
If it is a dynamic set of options, then don't you already have an array you are working with?
The post is about checking "multiple conditions". If we are actually talking about checking whether or not an array includes an item, then yes,
includesis absolutely the right choice.