let array=[]
let c=0
function primeFinder(n) {
for (let i=2;i<=n;i++){
c=0
for (let a=2;a<i;a++){
let num=i/a
if (num%1===0){
c++;
}
}
if (c===0){
array.push(i)
}
}
return array
}
console.log(primeFinder(11))
// Leave this so we can test your code:
module.exports = primeFinder;
This is my code for the JavaScript challenge “Prime Number Finder” the code works well but I can’t pass the tests. Can anyone tell me if there is a problem with my code?