overload the $() function
<p>Can I overload the $() function?<br>
I want to implement such pattern $('$name') where the string starts with '$' then I return my defined result. for example:</p>

<pre><code>function getElementByVarName(varName) {
    //return something of my own
}

var original$=$;
$=function(param) {
    if (typeof param === 'string' &amp;&amp; param.startsWith('$')) {
        return getElementByVarName(param.substring(1));
    } else {
        original$(param);
    }
}
</code></pre>

<p>What is the best way of doing so?</p>
