Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Can an anonymous function be assigned to a variable?

0 Answers  


What is an empty html tag?

0 Answers  


How to convert a string to a number using javascript?

0 Answers  


What do you understand by this keyword in javascript?

0 Answers  


What is javascript ‘strict mode’?

0 Answers  


What is the difference between "var" and "let" keywords?

0 Answers  


How to add behavior to an element using javascript?

0 Answers  


How to empty an array in JavaScript?

0 Answers  


<script type="text/javascript"> function dispValue(e) { v = function (s) { return e.name + ': ' + s } if (e.type == "") return v(e.checked ? "" : ""); else return v(e.value); }

0 Answers  


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

1 Answers  


Explain the difference between java and javascript.

0 Answers  


How to select an element by id and swapping an image?

0 Answers  


Categories