Count number of square integers in a given range of ints (faster function?)
You are correct that your solution is O(n). However, there is a possible solution for O(1). If you find the root of the first square (first) and the last square (last), then all of the numbers between first and last will yield squares in the range.
function numSquares(min,max) {
    const first = Math.ceil(Math.sqrt(min));
    const last = Math.floor(Math.sqrt(max));
    return last-first+1;
}

console.log(numSquares(465868129, 988379794));