oneOf = (val, arr) => {
  for (let i = 0; i < arr.length; i += 1) {
    if (looseEqual(arr[i], val)) {
      return true;
    }
  }
  return false;
}
This function validates that a value is part of an array
@param val the value
@param {Array} arr the array of alowed values