var numbers = [5, 3, 8, 6, 9, 1, 0, 2, 2];
var oddEvenCounts = numbers.reduce(function(counts, number) {
if (isOdd(number)) {
counts[odd]++;
} else {
counts[even]++;
}
}, {});
我正在尋找這一點的代碼中的錯誤(仍然學習減少方法;)) - 我哪裏錯了?Javascript減少方法創建累加器對象
什麼值存儲在變量'even'和'odd'? – Thomas