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

What are self Executing Functions?

0 Answers  


How do you check if a variable is an object

0 Answers  


How to port a GUI application onto Web

0 Answers   TCS,


What is the difference between java and java script?

9 Answers   IWW, Wipro,


How do you access an element in an HTML document with JavaScript?

0 Answers  






What data types are supported in Javascript?

0 Answers  


Explain why "self" is needed instead of "this".

0 Answers  


What is the difference between programing language and scripting language.?

3 Answers   Reliance, TCS,


What is the difference between remove() and removeChild()?

0 Answers  


Why do we need npm?

0 Answers  


What is stack queue?

0 Answers  


How can you detect the client operating system using javascript?

0 Answers  


Categories