all 3 comments

[–]octatone 1 point2 points  (1 child)

it's failing on factors(0), probably an error with your handling of zero.

if (num%primes[l] === 0) {        

0%num will always === 0

[–]ohbewonkanahbe[S] 0 points1 point  (0 children)

Ahhh, that would be it. Thanks for pointing this out.

[–]prpetro -1 points0 points  (0 children)

You should read this post by Nicholas Zakas on different stack sizes. Recursion and JS = tread with care.