Set Reference to document.location.search
<p>Throughout my code, I have statements like this:</p>

<pre><code>document.location.search="?a="+n;
</code></pre>

<p>I am trying to shorten (for code golf) it so that I do not have to type out the <code>document.location.search</code> every time.</p>

<p>The first thing I thought of was to set <code>document.location.search</code> to a variable, and then setting that variable, like this:</p>

<pre><code>s=document.location.search;
s="?a="+n;
</code></pre>

<p>This, of course, does not work, because s is set by the <em>value</em> of <code>document.location.search</code>, and not its <em>reference</em>. Is there a way to set s by reference? Is there some other way I can eliminate repeated instances of <code>document.location.search</code>?</p>
