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
What are self Executing Functions?
How do you check if a variable is an object
How to port a GUI application onto Web
What is the difference between java and java script?
How do you access an element in an HTML document with JavaScript?
What data types are supported in Javascript?
Explain why "self" is needed instead of "this".
What is the difference between programing language and scripting language.?
What is the difference between remove() and removeChild()?
Why do we need npm?
What is stack queue?
How can you detect the client operating system using javascript?