Skip to content

Commit e30ead3

Browse files
committed
fizz buzz
1 parent 8c06a9a commit e30ead3

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

find-avg.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
function findAvg(arr){
2+
var avg;
3+
var sum = 0;
4+
arr.foreach(function(elem){
5+
sum += elem;
6+
});
7+
avg = sum/arr.length;
8+
9+
return avg;
10+
11+
}

fizz-buzz.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
function fizzBuzz(num){
88
for(var i = 0; i <= num; i++){
9-
if(i % 15 === 0){
9+
if(i % 3 === 0 && i % 5 === 0){
1010
console.log('FizzBuzz');
1111
} else if (i % 3 === 0){
1212
console.log('Fizz');

0 commit comments

Comments
 (0)