Horje
if array ontains any item of another array js 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))
if array ontains any item of another array js
const found = arr1.some(r=> arr2.indexOf(r) >= 0)




Javascript

Related
check if array exists in another array javascript Code Example check if array exists in another array javascript Code Example
search string javascript Code Example search string javascript Code Example
jquery clone object Code Example jquery clone object Code Example
date in javascript Code Example date in javascript Code Example
javascript array buffer Code Example javascript array buffer Code Example

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