You’re almost there. Your test for whether the number is an integer is not quite right.
num % parseInt(num)
parseInt returns just the integer part of the number and then you are using the modulus operator with the original. What should the modulus operator return if both sides of the equation are the same? How would that return value work in an if statement?