header

Array Use Cases

May 23, 2020

Find intersection between two arrays

// if array.includes is supported
array1.filter(value => array2.includes(value))

// if array.includes is not supported
array1.filter(value => array2.indexOf(value) >= -1)