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
Is array an object javascript?
How can a particular frame be targeted, from a hyperlink, in javascript?
Does html5 replace javascript?
What is the difference of "settimeout" function and setinterval functions in javascript
why you used Java Script? Can it use for both client side and server side validation purpose?
12 Answers BeBo Technologies, HCL, Wipro,
What is scope variable in javascript?
How and where javascript namespacing is used?
What does clean white space mean?
What is the most widely used programming language?
How many functions are there in javascript?
What does => mean in node js?
Is javascript multi-threaded or single-threaded?