intersection (array1, array2) {
    if (!array1 || !array2) {
      return []
    }
    array1 = Array.isArray(array1) ? array1 : [array1]
    array2 = Array.isArray(array2) ? array2 : [array2]
    const result = []
    let item
    let i
    const len = array1.length
    for (i = 0; i < len; i++) {
      item = array1[i]
      if (result.indexOf(item) !== -1) {
        continue
      }
      if (array2.indexOf(item) !== -1) {
        result.push(item)
      }
    }
    return result
  }
Return the intersection of two arrays.

@example
import { utils } from 'js-data';
const arrA = ['green', 'red', 'blue', 'red'];
const arrB = ['green', 'yellow', 'red'];
const intersected = utils.intersection(arrA, arrB);

console.log(intersected); // ['green', 'red'])

@method utils.intersection
@param {array} array1 First array.
@param {array} array2 Second array.
@returns {Array} Array of elements common to both arrays.
@since 3.0.0