num % 2 is num mod 2, which just means the remainder of the number after being divided by two.
What you would really like to do is something like this:
primes = [2]
for (var i=0;i<primes.length;i++){
if (primes[i]<sqrt(num)){
if (num % primes[i] == 0){
console.log("Not prime!");}
}
else{
console.log("prime!");
primes.push(num);
}
}
When you're determining primes, you should only be trying to construct the prime factorization of the number you're checking, otherwise you're doing FAR more work than you should be doing. Since the prime factorization is by definition constructed of primes, those are the only numbers you should check for modularity.
Additionally you should only check up to the square root of the number because any number that it is divisible by will have a matching number. Examples:
104 = 57*2
39 = 13*3
Complexity goes from O(n) to O(log(sqrt(n)) which is 4 comparisons instead of 100 even at an n of just 100 and it just keeps getting better.