List every factor of a positive integer, plus its prime factorization.
It only needs to test divisors up to √n — for each divisor i that divides n evenly, both i and n/i are factors, so it finds matching pairs without checking every number up to n.
Each pair is two factors that multiply together to give the original number (e.g. for 12: 1×12, 2×6, 3×4). Every factor in the full list belongs to exactly one such pair.
The trial-division method checks divisors up to √n in the browser, so it's capped at numbers up to 100 million to keep the calculation fast and responsive.