Here is a JavaScript code snippet that I am working on:
var inx=[2,3,4,5];
var valarray=[];
for (i=0; i<inx.length; i++) {
valarray[i]==inx[i];
}
for (i=0; i<inx.length; i++) {
var posi=inx.indexOf(3);
var valy=valarray[posi-1]+1;
valarray[i]=valy;
}
alert(valarray);
However, the valarray variable keeps returning nan, nan, nan, nan instead of numbers.
Any suggestions on how to resolve this issue?