Skip to content

Instantly share code, notes, and snippets.

@KameronKales
Created June 14, 2019 20:13
Show Gist options
  • Save KameronKales/494f0dc21227a0508890ecc0950fb2c6 to your computer and use it in GitHub Desktop.
Save KameronKales/494f0dc21227a0508890ecc0950fb2c6 to your computer and use it in GitHub Desktop.
A better fizzbuzz example
for (let i = 1; i < 101; i++) {
let solved = i % 15 === 0 ? `${i} is divisible by 15, FizzBuzz` : i % 3 === 0 ? `${i} is divisible by 3, Fizz` : i % 5 === 0 ? `${i} is divisible by 5, Buzz` : i
console.log(solved)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment