Weird JavaScript Code
<pre><code>for (var i=a.length-1;i&gt;0;i--) {
    if (i!=a.indexOf(a.charAt(i))) {
        a=a.substring(0,i)+a.substring(i+1);
    }
}
</code></pre>

<p>I found this in a web app I'm auditing, it just baffles me why it's there.
I can't seem to see a case where <code>i!=a.indexOf(a.charAt(i))</code> would be false.</p>

<p>The value the pass to it is:</p>

<pre><code>a = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
</code></pre>

<p>There is no comment either //sigh</p>
