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 is argument objects in javascript & how to get the type of arguments passed to a function?
What is node value?
What are the variable naming conventions in javascript?
How to reload a page using JavaScript?
What would you use javascript for?
Explain window.onload and ondocumentready?
How do I turn off javascript in chrome?
how to use java script
Why are callbacks used?
How can javascript codes be hidden from old browsers that don't support javascript?
What is a “closure” in JavaScript? Provide an example
What is the difference between synchronous and asynchronous JavaScrip