Skip to content

Commit

Permalink
FizzBuzz finished
Browse files Browse the repository at this point in the history
  • Loading branch information
Valen98 committed Sep 23, 2024
1 parent 164ec37 commit aa3dddd
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/fizzbuzz.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
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)
}
}

console.log(answer)



Expand Down

0 comments on commit aa3dddd

Please sign in to comment.