Recursive prime factors function written in JS using jasmine.