I have a target array [\"apple\",\"banana\",\"orange\"], and I want to check if other arrays contain any one of the target array elements.
[\"apple\",\"banana\",\"orange\"]
For example:
Update @Paul Grimshaw answer, use includes insteed of indexOf for more readable
includes
indexOf
let found = arr1.some(r=> arr2.indexOf(r) >= 0) let found = arr1.some(r=> arr2.includes(r))