function intersectValues(base, selected, defaultEmptyValue, callback) {
  var result = [];
  var same = base === selected;
  var selectedItemsAssertion;

  if (!same) {
    selectedItemsAssertion = createArrayAssertion(selected);
  }

  (0, _array.arrayEach)(base, function (value) {
    var checked = false;

    if (same || selectedItemsAssertion(value)) {
      checked = true;
    }

    var item = {
      checked: checked,
      value: value,
      visualValue: toVisualValue(value, defaultEmptyValue)
    };

    if (callback) {
      callback(item);
    }

    result.push(item);
  });
  return result;
}
Intersect 'base' values with 'selected' values and return an array of object.

@param {Array} base An array of base values.
@param {Array} selected An array of selected values.
@param {String} defaultEmptyValue Default value for empty cells.
@param {Function} [callback] A callback function which is invoked for every item in an array.
@returns {Array}