Why does this not work? javascript
<p>I have this in Javascript:</p>

<pre><code>var inx=[2,3,4,5];
var valarray=[];
for (i=0; i&lt;inx.length; i++) {
    valarray[i]==inx[i];
}
for (i=0; i&lt;inx.length; i++) {
    var posi=inx.indexOf(3);
    var valy=valarray[posi-1]+1;
    valarray[i]=valy;
}
alert(valarray);
</code></pre>

<p>valarray keeps returning nan,nan,nan,nan instead of numbers...</p>

<p>How can I fix this?</p>
