Function factorial

  • Compute the factorial of non-negative integer n.

    Parameters

    • n: number

      A non-negative integer.

    Returns number

    Returns the product of all positive integers less than or equal to n.

    Since

    0.1.0

    Example

    factorial(4)
    // => 24