I Have to write a program in javascript to print 1000 prime numbers using and Array[] and a “for(in) loop” and i have come up with a complete brain block it has been years since i have messed with javascript.I have to do this for a college assignment in web programming. if someone could help me out i would be greatly appreciated….Heres what I have so far i don’t think its even close
<html>
<head>
<title>Untitled</title>
<script>
</script>
</head>
<body>
<script language =”JavaScript”>
var Prime = new Array;// the Array destined to hold the prime numbers
Prim3 [0]=2
var Num =3 //number being checked
var count ; // general counter
for (count =0;count<= 1000;count++){
}
for ( var i = 2; i < NumPrim[count]; i++){
NumPrim[count]++
}
document.write(NumPrim[count] + “<br>”)
</script>
</body>
</html>