Function exponential

  • Generate an infinite iterable of integers beginning with base and increasing exponentially until reaching Number.MAX_SAFE_INTEGER, after which the generator will continue yielding Number.MAX_SAFE_INTEGER forever.

    By default, this increases exponentially by a factor of 2; you may optionally pass { factor: someOtherValue } to change the exponentiation factor.

    If you pass a non-integral value as base, it will be rounded to the nearest integral value using Math.round.

    Parameters

    • Optionaloptions: { from?: number; withFactor?: number }
      • Optionalfrom?: number

        Initial delay duration in milliseconds. Default is 1.

      • OptionalwithFactor?: number

        Exponentiation factor. Default is 2.

        Important

        Setting this to a value less than 1 will cause the delay intervals to decay rather than increase. This is rarely what you want!

    Returns Strategy