fn = function (x) {
    if (typeof x === 'number') {
      return Math.exp(a) * Math.exp(b * x);
    } else {
      return x.map(function (d) {
        return Math.exp(a) * Math.exp(b * d);
      });
    }
  }
Create a function to calculate the exponential regression of a dataset.

@param {Array} set of values.
@return {Function} function to accept X values and return corresponding regression Y values.