Decreasing the loop's upper bound to Math.sqrt(value) and only testing odd values after 2 are really simple ways to improve performance.
Beyond that it'd be nice to build a list of previously determined primes to reduce your number of checks, but I guess at that point it might just be better to implement classic primality tests...
Beyond that it'd be nice to build a list of previously determined primes to reduce your number of checks, but I guess at that point it might just be better to implement classic primality tests...