Answers for "js check array item contain on other array"

10

javascript check if elements of one array are in another

const found = arr1.some(r=> arr2.includes(r))
Posted by: Guest on March-26-2020
0

how to check all elements in array includes in another array javascript

// how to check all elements in array includes in another array javascript
const includesAll = (arr, values) => values.every(v => arr.includes(v));
includesAll([1, 2, 3, 4], [1, 4]); // true
includesAll([1, 2, 3, 4], [1, 5]); // false
Posted by: Guest on January-03-2022

Code answers related to "js check array item contain on other array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language