You are viewing a single comment's thread. Return to all comments →
Nice. This line looks a little weird to me:
Math.sqrt(n) % 1 == 0
Any integer % 1 is always 0. So it seems that line is just checking if the square root of n is an integer or not.
yes, that's what I do to avoid checking
sum += n == divisor ? 0 : divisor;
inside the loop.