Mmmh it might just do what you want but it makes me nervous.
Parsing means reading text, but you’re dealing with numbers. It may end up with the same result because of implicit conversion to string but it means something else. Math.round or Math.ceil would be more appropriate.
Rather than computing the square root twice, use a variable to store the result so that you can use it more than once.
Seeing floating point math mixed with === operators also makes me unhappy, because floats are approximations. Ideally this should only use integer operations to avoid cases like 3.9999999999999997 getting truncated to 3, turning a very small error (which would have been avoided sticking to integers) into a very large one.
(Trying to get an exact answer while using inexact math operations means having to reason a whole lot about whether it’s correct or not, it’s much easier to stick with integers, floats are often not what you want)
…On the other hand js doesn’t provide an integer version of sqrt, so the reasonable thing here is to use Math.sqrt anyway, and use Math.round which will correct any errors because they’ll be very small (unless input numbers are very large) and will therefore get rounded in the right direction)
So, same thing but use Math.round instead which is more appropriate.
bottom line, floats are usually not what you want. use integers.