IncludesAny doubt

When I try to use in a function it doesn’t seem to work…

Code: https://imgur.com/a/9ejyFTm

But in practice a small bug happens…

In case it wasn’t obvious, the <Array>.includesAny() method is an Array method—i.e., it only works on arrays. The first argument you’re supplying to the widget is a string, not an array, thus the error.

You can reverse what you’re attempting, wrapping the names in an array and passing $args[0] to the method instead. For example:

<<elseif ["peter", "rey", "willy"].includesAny($args[0])>>

PS: Please post code next time, rather than an image of it.

1 Like

Thanks so much, using the “includes” method it works, following this line I tried the way I showed above… What a shame… I still have a lot to learn.