factors-of-n

A library to find factors for a given input

Usage no npm install needed!

<script type="module">
  import factorsOfN from 'https://cdn.skypack.dev/factors-of-n';
</script>

README

Factors Of n

A function to get factors of a given input n.

constraints

n > 0

Usage

npm install --save factors
let factors = require('factors');

factors(16); // [ 1, 2, 4, 8, 16 ]
factors(178990); /* [ 1, 2, 5, 7, 10, 14, 35, 70, 2557, 5114, 12785, 17899, 25570,
                      35798, 89495, 178990 ] *

Test

run npm test