DEV Community

Discussion on: Prime numbers

Collapse
lukaszahradnik profile image
Lukáš Zahradník

It doesn't replace the conditional which checks if the number is even. That condition is still important.

Prime numbers are not even (except 2), so we don't have to check if they are divisible by even number.

Thread Thread
jamesrweb profile image
James Robb Author • Edited on

Exactly, if you check the article, I added as much to the implementation section and tagged you with the kudos 😉

Thread Thread
lukaszahradnik profile image
Lukáš Zahradník

Nice! Thanks for tagging, it wasn't really needed. I just wanted to improve solution.

Thread Thread
jamesrweb profile image
James Robb Author

I always give credit where credits due so all good and thanks again for the comment 🙂👍.