Skip to content

Commit

Permalink
completed #17
Browse files Browse the repository at this point in the history
  • Loading branch information
kinwail committed Jun 12, 2018
1 parent df5742f commit b57edc1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions exercises.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,8 @@ for (var i =0; i<players.length; i++){
* Create a for loop that will iterate and console.log each item in the array below:
*/
var myFavFoods = ["lemon bar", "carrot cake", "nachos", "bacon cheeseburger", "ramen", "sweet potato fries", "chimichanga"];
for(var i =0; i<myFaveFoods.length;i++){
console.log(myFavFood[i]);
for(var i =0; i<myFavFoods.length;i++){
console.log(myFavFoods[i]);
}


Expand All @@ -415,6 +415,15 @@ for(var i =0; i<myFaveFoods.length;i++){
*/


var numArray = [2,5,7,9,10];
var total = 0;
function sumItUp(arr){
for(var i=0;i<numArray.length;i++){
total +=numArray[i]
}
return total
}
console.log(sumItUp(numArray));

/*
* #18
Expand Down

0 comments on commit b57edc1

Please sign in to comment.