In javascript, can I use the modulus operator (%) on variables instead of integers? : <p>I'm working on a Euler problem and am trying to build a function that checks a number to see if its a prime.  I get error messages about the line:</p>

<pre><code>if (a)%(b)==0{
</code></pre>

<p>Is my syntax wrong or is it impossible to use % on a variable rather on an integer?</p>

<pre><code>var x = Math.sqrt(600851475143);
var y = Math.round(x);
y++;
console.log(y);

//find all of the prime numbers up to the square root number.  Put them in an array.  
//Check each ascending number against the prime numbers in the array to see if %=0

var primes = [2,3];
var a =(3);

while (a&lt;y){
    a++;
    isPrime(a)
}
function isPrime(arr){
for (var i = 0; i &lt; arr.length; i++){
    var b = primes[i];
    //next line is a problem
    if (a)%(b)==0{
        break
    }else{
        primes.push(a);
        }
    }
}
</code></pre>
