angular check if array contains any code example
Example 1: javascript check if elements of one array are in another
const found = arr1.some(r=> arr2.includes(r))
Example 2: how to check if an array contains a number in javascript
// To check if an array contains a number
const ratings = [1,2,3,4,5];
let result = ratings.includes(4);
console.log(result); // true
result = ratings.includes(6);
console.log(result); // false