我要数A队和B队3连胜的次数。似乎总是进入最后的ifs。不是当 consecutivas 等于 3,6,9...
var consecutivasA = 0;
var consecutivasB = 0;
var plusA = 0;
var plusB = 0;
for (var i = 2; i <= 30; i++) {
var row = values[i];
if (row[3] > row[4]) {
consecutivasA++;
consecutivasB = 0;
}
else if (row[3] < row[4]) {
consecutivasB++;
consecutivasA = 0;
}
else {
consecutivasA = 0;
consecutivasB = 0;
}
if (consecutivasB % 3 == 0) { plusB++; }
if (consecutivasA % 3 == 0) { plusA++; }