Skip to content

Instantly share code, notes, and snippets.

@wedburst
Created October 23, 2020 18:18
Show Gist options
  • Select an option

  • Save wedburst/3c520c54e99940d0009384ce693f19d0 to your computer and use it in GitHub Desktop.

Select an option

Save wedburst/3c520c54e99940d0009384ce693f19d0 to your computer and use it in GitHub Desktop.
// 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