0

js_err

1

this code chuck returns bigint err., but the same code works fine in vscode but it works not in IDE

function solve(A) {

    if (findPrime(A) == 2) { console.log("true 1"); } else { console.log("false 0"); }

    function findPrime(pr) {

        var count = 0;
        for (var i = 1; i <= (Math.floor(Math.sqrt(pr))); i++) {
            if (pr % i == 0) {
                if (i == (pr / i)) { count = count + 1; } else { count = count + 2; }
            }
        }
        return count;
    }
}
vimuth
  • 5,064
  • 33
  • 79
  • 116

0 Answers0