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;
}
Is function a data type in javascript?
What are the distinct types of error name values?
Are javascript variables global?
Does javascript have the concept level scope?
what is the difference between window & document in javascript?
How do you write an if statement in javascript?
accessdenied javanet disconnet
What is dom in javascript?
How do I save javascript?
What is the difference between ‘function declaration’ and ‘function expression’?
How do you trim in javascript?
What's the difference methods get and post in html forms?