JavaScript - replace substring using a variable
<pre><code>var prefix = 'pre-',
    number = 1,
    combined = prefix + number,
    prefixRemoved = combined.replace('/' + prefix + '/g', '');
console.debug(prefixRemoved);
</code></pre>

<p>How do I remove <code>prefix</code> from <code>combined</code>? I'm still getting <code>pre-1</code> as a result.</p>
