3 ms·
I don't know who gave him that awful code for checking array membership in perl, but you can just do: grep { $_ == VALUE } @array and evaluate that in a scala
by foldr 17y ago
I don't know who gave him that awful code for checking array membership in perl, but you can just do:
grep { $_ == VALUE } @array
and evaluate that in a scalar context. The intent of this is pretty clear if you know what "grep" does.