Horje
javascript array includes another array Code Example
javascript array includes another array
const array1= ["cheese", "dough", "sauce", "pepperoni"]
const array2= ["mozzarella", "peppers", "chicken", "cheese"]

const isIncluded =  array1.some(value => array2.includes(value))
// true

const values = array1.filter(value => array2.includes(value))
// "cheese"
Source: dev.to
javascript check if elements of one array are in another
const found = arr1.some(r=> arr2.includes(r))
angular one array contains any of second
const found = arr1.some(r=> arr2.includes(r))
if array ontains any item of another array js
const found = arr1.some(r=> arr2.indexOf(r) >= 0)




Javascript

Related
how to get value and key in a for of loop in js Code Example how to get value and key in a for of loop in js Code Example
ace get contents of editor Code Example ace get contents of editor Code Example
javascript split get last element Code Example javascript split get last element Code Example
how to remove a class in js after 100 milliseconds Code Example how to remove a class in js after 100 milliseconds Code Example
javascript audio stop Code Example javascript audio stop Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
6