i have this for loop:
for (var i = 0; i < pictures.length; i++) {
var mod = i % 4;
alert(mod); // first
//get the current row
if (mod == 0)
{
alert(mod); //second
tableBody.innerHTML += "<tr>";
}
tableBody.innerHTML += "<td><img style='width:146px; height:146px;' src='" + pictures[i].source + "'></td>";
if (mod == 0)
tableBody.innerHTML += "</tr>";
}
how come my first alert shows the result of the math calculation inside "mod" variable, and the second alert show always zero ??
if (mod == 0)statement...