Created
October 23, 2020 18:18
-
-
Save wedburst/3c520c54e99940d0009384ce693f19d0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Adding element and agree FizzBazz | |
| var output = []; | |
| var count = 1; | |
| function fizzbuzz(){ | |
| while(count <= 15){ | |
| if(count % 3 === 0 && count % 5 === 0 ){ | |
| output.push("FizzBazz"); | |
| }else if(count % 3 === 0){ | |
| output.push("Fizz"); | |
| }else if(count % 5 === 0){ | |
| output.push("Bazz"); | |
| }else{ | |
| output.push(count); | |
| } | |
| count ++; | |
| } | |
| console.log(output); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment