Below is my script
var num=1;
var validator =false;
while(!validator){
for(var k=1;k<=N;k++)
{
if(num%k==0)
{
validator = true;
}
else
{
validator = false;
break;
}
}
num = num+1;
}
console.log("number is: "+parseInt(num-1));
The above code gives the result when N=10 i.e "the number is: 2520" But when i change the value of N=20, the script stops responding. Can anybody explain me why so & how can i determine till what level of computational complexity Javascript can compute. Thanks.