• Get the factors of a number

    Parameters

    • input: number

    Returns number[]

    Example

    import { number } from "@rjweb/utils"

    number.factors(5) // [1, 5]
    number.factors(10) // [1, 2, 5, 10]

    Since

    1.12.17

    Supports

    nodejs, browser