In JavaScript you can use .includes() to return a boolean.
If you not searching by an element but by condition you can also use .some() to return true or false and .find() to return the value/object or undefined.
Tip: If you don't like [1, 2, 3].indexOf(4) !== -1 you can write ~[1, 2, 3].indexOf(4). (Type is still Number!)