Same JavaScript function returns random results
<p>I'm confused:</p>

<pre><code>function is_valid(name) {
    var regexp_name = /^(\d|\w)*$/gi;
    return regexp_name.test(name);
}
</code></pre>

<hr>

<pre><code>// Console
console.log(is_valid("Test"));
=&gt; true

console.log(is_valid("Test"));
=&gt; false

console.log(is_valid("Test"));
=&gt; true

console.log(is_valid("Test"));
=&gt; false
</code></pre>

<p>What am I doing wrong?</p>
