Primo test in Javascript