+ 1

Pls, Help. Why this code does not print anything?

Why this code does not print anything? This code should output an array with prime numbers. But why does not it show why this is happening. https://code.sololearn.com/WiK44L3Epz7r/?ref=app

5th Jan 2018, 7:13 AM
ℬℯℳℬℐ
ℬℯℳℬℐ - avatar
3 Respuestas
+ 13
I would advise you to double check the algorithm again as there's a bug in the program which initialize the array in every iteration.
5th Jan 2018, 7:29 AM
Zephyr Koo
Zephyr Koo - avatar
+ 7
You must also remove line 20 (arr = [];) for the desired result (not talking about the desired algorithm here).
5th Jan 2018, 7:29 AM
Dev
Dev - avatar
+ 2
<button onclick="t()">gkfgd</button>
5th Jan 2018, 7:28 AM
Calviղ
Calviղ - avatar