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:
Just one more solution
var a1 = [1, 2, 3, 4, 5] var a2 = [2, 4]
Check if a1 contain all element of a2
var result = a1.filter(e => a2.indexOf(e) !== -1).length === a2.length console.log(result)