Done!I have 3 evaluations at first "n==1 (not prime) or if n==2 (for even numbers) and (n%2)==0, if this is true, returns 'Not prime'."Then we loop from 3 to sqrt(n),counter i increases by 2 because we don't have to check for even numbers.And if n% counter i == 0 the number is not a prime.After all the evaluations,we are left with prime numbers,does that make sense?
Dynamic and passionate Software Developer with experience in designing and developing user-centric and robust systems and applications. Strategic and creative thinker, with the ability to articulate a
Done!I have 3 evaluations at first "n==1 (not prime) or if n==2 (for even numbers) and (n%2)==0, if this is true, returns 'Not prime'."Then we loop from 3 to sqrt(n),counter i increases by 2 because we don't have to check for even numbers.And if n% counter i == 0 the number is not a prime.After all the evaluations,we are left with prime numbers,does that make sense?
function primality(n) {
}
awesome Miami Larry for this awesome explanation of your solution