Function fibonacci

  • Calculates the nth Fibonacci number.

    Returns

    The nth Fibonacci number.

    Throws

    An error if n is not a non-negative integer.

    Parameters

    • n: number

      The index of the Fibonacci number to calculate. Must be a non-negative integer.

    Returns number

Generated using TypeDoc