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

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

0 Answers  


Which is faster jquery or javascript?

0 Answers  


Which type of variable among global and local, takes precedence over other if names are same?

0 Answers  


How to set the cursor to wait?

0 Answers  


Write about the errors shown in javascript?

0 Answers  






what are the differences between as2 and as3?

0 Answers  


How we can add title of the page by javascript?

0 Answers  


What data types are supported in Javascript?

0 Answers  


How to port a GUI application onto Web

0 Answers   TCS,


What is object freeze?

0 Answers  


What is the source code for include() & forwrd() method servlet program?

1 Answers  


Is webassembly faster than javascript?

0 Answers  


Categories