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

Is function a data type in javascript?

0 Answers  


What are the distinct types of error name values?

0 Answers  


Are javascript variables global?

0 Answers  


Does javascript have the concept level scope?

0 Answers  


what is the difference between window & document in javascript?

0 Answers  


How do you write an if statement in javascript?

0 Answers  


accessdenied javanet disconnet

0 Answers   Reliance,


What is dom in javascript?

0 Answers  


How do I save javascript?

0 Answers  


What is the difference between ‘function declaration’ and ‘function expression’?

0 Answers  


How do you trim in javascript?

0 Answers  


What's the difference methods get and post in html forms?

0 Answers  


Categories