So I mede the prime number generator in JavaScript:

```
function prime(from, to) {
        for (var i = from; i <= to; i++) {
            var IsPrime = false;
            for (var j = from; j < i; j++) {
                if (i % j == 0) {
                    IsPrime = true;
                }
            }
            if (IsPrime == false) {
                console.log([i]);
            }
        }
    }

    prime(2, 9999);

```

But the output looks like this...

```
[2]
[3]
[5]
[7]
[11]
...

```

...and I want it to look like this:

```
[2,3,5,7,11...]

```

can someone help me?
thanks for your ideas;-)