Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let pt = [2], i, prim
- for(i=3;i<1000;i+=2) {
- prim=true ;
- pt.forEach(v => {
- if ( !(i%v) ) prim=false
- })
- if (prim) pt.push(i)
- }
- let ph = new Set(pt)
- console.log(ph.has(998));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement