This is the function I am currently working on:
function getSmallestDivisor(xVal) { if (xVal % 2 === 0) { return 2; } else if (xVal % 3
if (xSqrt % 1 === 0) { // Because if your function walks this way // it does not meet any 'return' statement // till the end and returns nothing. getSmallestDivisor(xSqrt); } else { return xVal; }