What does index() return on failure?

Im filtering a list of logs by a list of given eids and would like to use the index() operator as the condition of the filter. Like
return = logs.filter(log){ eids.index(log{“eid”}) };
Would I need to compare the index with -1?

Yes, the index() operator returns -1 if no match is found. The documentation for index() has been updated to indicate this.

return = logs.filter(log){ eids.index(log{"eid"}) != -1 };