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
Methods get and post in html forms - what's the difference?
Which is faster jquery or javascript?
Which type of variable among global and local, takes precedence over other if names are same?
How to set the cursor to wait?
Write about the errors shown in javascript?
what are the differences between as2 and as3?
How we can add title of the page by javascript?
What data types are supported in Javascript?
How to port a GUI application onto Web
What is object freeze?
What is the source code for include() & forwrd() method servlet program?
Is webassembly faster than javascript?