check if a vector contains an element js code example
Example 1: if vector contains value c++
#include <algorithm>
if(std::find(v.begin(), v.end(), x) != v.end()) {
/* v contains x */
} else {
/* v does not contain x */
}
Example 2: see if array contains array javascript
const found = arr1.some(r=> arr2.indexOf(r) >= 0)