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 handle event handlers?
Methods get and post in html forms - what's the difference?
Can any one tell me how Java is purely an Oops language
What are the methods of validating whether the form is secure?
Explain “use strict” ?
Which symbol is used for comments in Javascript?
What is the difference between scripting and programming?
why you used Java Script? Can it use for both client side and server side validation purpose?
12 Answers BeBo Technologies, HCL, Wipro,
what does javascript null mean?
Is python better than javascript?
Is function a data type in javascript?
How to disable an html object ?