Reference syntax does not match behavior for replace()
<p>The function below does not work unless I assume that .replace returns the new string.  The syntax implies that the input string itself it modified.</p>

<p><strong>MDN</strong></p>

<pre><code>str.replace(regexp|substr, newSubStr|function[, Non-standardflags]);
</code></pre>

<p><strong>Code</strong></p>

<pre><code>escape: function ( second_split )
{
    for( element in second_split )
    {
    second_split[element] = second_split[element].replace('**', '*');
    second_split[element] = second_split[element].replace('*|', '|');
    }
return second_split;
},
</code></pre>
