What is missing in my code?
function numberTally(numList) {
var evenTotal = 0;
var oddTotal = 0;
for (var i = 0; i <= numList.length; i++) {
if i % 2 { // i is odd
oddTotal += numList[i];
// or oddTotal = oddTotal +
numList[i];
}
else { // i is even
evenTotal + numList[i];
}
}
alert(oddTotal);
return evenTotal;
}
No Answer is Posted For this Question
Be the First to Post Answer
How to use strings as array indexes using javascript?
What is triple dot in javascript?
Why extending array is bad idea?
What is the difference between local storage & session storage?
Is javascript necessary for web development?
What is the difference between let and var?
Explain higher-order functions in javascript?
What is lambda in programming?
What does clean white space mean?
Explain how can you submit a form using JavaScript?
What is difference between ajax and javascript?
How do you round a value in javascript?