Skip to content

Commit

Permalink
Completed exercise
Browse files Browse the repository at this point in the history
  • Loading branch information
tuvaea committed Sep 23, 2024
1 parent 164ec37 commit ecd8f21
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/fizzbuzz.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@ const answer = []

// Write your code below this line

for (let i = 1; i <= 15; i++) {
if (i % 3 === 0 && i % 5 === 0) {
answer.push('FizzBuzz')
} else if (i % 3 === 0) {
answer.push('Fizz')
} else if (i % 5 === 0) {
answer.push('Buzz')
} else {
answer.push(i)
}
}




Expand Down

0 comments on commit ecd8f21

Please sign in to comment.