Skip to content

Instantly share code, notes, and snippets.

View astout's full-sized avatar

Alex Stout astout

View GitHub Profile
@astout
astout / fizzbuzz.js
Created January 10, 2018 17:02
FizzBuzz Interview Practice
function fizzbuzz(fizz = 3, buzz = 5, max = 100) {
for (let i = 0; i <= max; i += 1) {
if (i % fizz === 0 && i % buzz === 0) {
console.log('fizzbuzz');
} else if (i % fizz === 0) {
console.log('fizz');
} else if (i % buzz === 0) {
console.log('buzz');
} else {
console.log(i);