- This is a simple package that allows you to get all the numbers a number can be divided with, or get all the multiples of anynumber!
npm install divisors-and-multiples
const divisorsAndMultiples = require('divisors-and-multiples'); // requiring the package
console.log(divisorsAndMultiples.findDivisors(6)); // output: [1, 2, 3, 6]
console.log(divisorsAndMultiples.findMultiples(4)); // output: [4, 8, 12, 16,..., 400]
- The limit for the number in
findDivisors
andfindMultiples
is 99,999,999. One of the reasons that number is max is speed. - Depending on the number you give, the functions go and try to divide/multiply your number with every number from 1 to 99,999,999 so it makes our code run slower if the number is bigger...