javaScript проверьте, есть ли элементы одного массива в другом
const found = arr1.some(r=> arr2.includes(r))
Easy Earthworm
const found = arr1.some(r=> arr2.includes(r))
const allEqual = arr => arr.every(v => v === arr[0]);
allEqual([1,1,1,1]); // true
const intersection = array1.filter(element => array2.includes(element));
function hasDuplicates(array) {
return (new Set(array)).size !== array.length;
}
const allEqual = arr => arr.every( v => v === arr[0] )
allEqual( [1,1,1,1] ) // true