intersect()

Gets a new array that will be the intersection of two arrays.

This function is valid in v2.1.0 to v2.13.1. This function has been downloaded 23 times.

Parameters

{Array} array1
First array to be intersected with the second array.
{Array} array2
Second array to be intersected with the first array.

Returns

{Array}
An array with all of the values that array1 and array2 share while each value only appears as many times as the minimum amount of times it is found in either array.

Required Function

This function requires the following function which is included automatically:

  • diffArrays()
    Creates a new array which is the difference of the two given arrays.