How to check for prime numbers in Javascript

Hello,
I’m trying to find primes in Javascript.

If anyone knows how to do this and explain it it would be m uch appreciated.

Thanks,
zm476

What code have you tried? We are not just going to give you the code

2 Likes

And just to clarify, there is no built-in function in JS that will find primes for you. You have to create the function yourself, which is what @Cody_Biggs was getting at.

2 Likes

I’ve tried everything that I could think of and I can’t find an efficient and fast idea.

We cant help without seeing what you have tried

Here is a hint. You can use this

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.