Function factorial

  • Get the factorial of a number

    Parameters

    • input: number

    Returns number

    Example

    import { number } from "@rjweb/utils"

    number.factorial(5) // 120
    number.factorial(10) // 3628800
    number.factorial(0) // 1
    number.factorial(-1) // 1

    Since

    1.12.17

    Supports

    nodejs, browser