for(var j=0;j<hope.length/2;j++){ for(var i=j;i<hope.length;i=i+hope.length/2){ arrayHope.push(parseFloat(hope[i].innerHTML)); } }