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
what is onfocus and onblur events in java script?
What is the role of a strict mode in javascript?
Explain typecasting in javascript?
What are the Advantages and Disadvantages of JavaScript?
Write a way by which you can do something on the close of the window ?
Can you explain the difference between == and ===?
Write a Program using Servlet and JDBC for developing online application for displaying the details of Cars owned by the residents in XYZ society. Make necessary assumptions and create appropriate databases
Event bubbling and Event Capturing in JavScript?
Is javascript whitespace sensitive?
What's relationship between JavaScript and ECMAScript? And What are JavaScript types?
What is the difference between push() and concat() in javascript?
Is everything in javascript asynchronous?