Skip to content

Commit

Permalink
Add fizzBuzz algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladyslav Burdeniuk authored and Vladyslav Burdeniuk committed Nov 7, 2017
1 parent 9190305 commit 6ae6072
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions fizz-buzz/fizz-buzz.algorithm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function fizzBuzz(num) {
for (let i = 0; i <= num; i++) {
if (i % 15 === 0) console.log('FizzBuzz');
else if (i % 3 === 0) console.log('Fizz');
else if (i % 5 === 0) console.log('Buzz');
else console.log(i);
}
}

fizzBuzz(30);

0 comments on commit 6ae6072

Please sign in to comment.