Hello guys!
Could you tell me whether my bit of code is alright? It runs properly but the style might benefit from pointers.
Here is the link to my code: Loops3 exercise
Hello guys!
Could you tell me whether my bit of code is alright? It runs properly but the style might benefit from pointers.
Here is the link to my code: Loops3 exercise
Hi @Halden-Aratro and welcome to the community
Congratulations! This looks pretty good.
There’s one thing which would make the code simpler: Instead of using if (isPrime(i) === true) {
you could just write if (isPrime(i)) {
.
Additional question: How could you get rid of the last semicolon after “2”?
I hope that helps.
Have a nice day,
Michael