Can anyone please explain the comma operator in FOR statement?
function funct_1(c){
for (var a = x, e = y; 0 < c; ){
var p = c/2;
var c = c/10; // wtf, it is already defined as function argument!!
}
}
Also, the last statement like "a++" seems to be missing. I have never seen anything like this. what does that mean?
The comma just adds separation for multiple declarations. In other words, your
forloop is settingaequal tox, as well aseequal toy.As for the lack of the increment statement, the fact that it is missing just means that the
forloop won't explicitly increment any variable.