function createArrayAssertion(initialData) {
  var dataset = initialData;

  if (SUPPORT_SET_CONSTRUCTOR) {
    dataset = new Set(dataset);
  }

  return function (value) {
    var result;

    if (SUPPORT_SET_CONSTRUCTOR) {
      result = dataset.has(value);
    } else {
      /* eslint-disable no-bitwise */
      result = !!~dataset.indexOf(value);
    }

    return result;
  };
}
Create an array assertion to compare if an element exists in that array (in a more efficient way than .indexOf).

@param {Array} initialData Values to compare.
@returns {Function}