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

Post New Answer

More JavaScript Interview Questions

How to handle event handlers?

0 Answers  


Methods get and post in html forms - what's the difference?

0 Answers  


Can any one tell me how Java is purely an Oops language

3 Answers  


What are the methods of validating whether the form is secure?

1 Answers  


Explain “use strict” ?

0 Answers  






Which symbol is used for comments in Javascript?

0 Answers  


What is the difference between scripting and programming?

0 Answers  


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?

0 Answers  


Is python better than javascript?

0 Answers  


Is function a data type in javascript?

0 Answers  


How to disable an html object ?

0 Answers  


Categories