function primeNumbers(n) {
array = [];
for (var i = 2; array.length < n; i++) {
for (var count = 2; count < i; count++) {
var divisorFound = false;
if (i % count === 0) {
divisorFound = true;
break;
}
}
if (divisorFound == false) {array.push[i];}
}
return array;
}
当我运行这段代码时,它似乎陷入了无限循环并且没有返回任何东西......为什么?