Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var output = [];
- var count = 1;
- function fizzbuzz() {
- while (count <=100) {
- if (count % 3 === 0 && count % 5 ===0) {
- output.push("fizzbuzz");
- }
- else if (count % 3 ===0) {
- output.push("fizz");
- } else if (count % 5 ===0) {
- output.push("buzz");
- }
- else {
- output.push(count);
- }
- count++;
- console.log(output);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment