OK its late so I must be doing something stupid, but myreduction for loop which works fine in c# does not work in javascript. The loop is NEVER entered. What have I missed?
var count = 12;
var j = count - 3
for (i = count; i<1 ; i--)
{
if (i % 3 == 0)
break;
else
j = i - 1;
}
alert(j);
In this case I am expecting the following:
12 -> 9;
11 -> 7;
10 -> 7;
9 -> 6;
8 -> 4;
7 -> 4;
??
You want the loop to continue while i is greater than 1 (perhaps this might differ with this logic change)