function primos() { let esPrimo = true; for(let i=100;i>1;i--){ for(let j = 2;j<i;j++){ if(i%j == 0){ esPrimo = false; break; } } if(esPrimo){ console.log("Primo: "+i); }else{ esPrimo = true; } } } primos();