Skip to content

Instantly share code, notes, and snippets.

@EverlastingBugstopper
Created February 18, 2025 17:53
Show Gist options
  • Select an option

  • Save EverlastingBugstopper/45fdbf12b7115643153bcec23112dde0 to your computer and use it in GitHub Desktop.

Select an option

Save EverlastingBugstopper/45fdbf12b7115643153bcec23112dde0 to your computer and use it in GitHub Desktop.
fun fizz buzz one-liner
const fizzBuzz = (length) => Array.from({ length }, (_, i) => i++).forEach((i) => console.log(`${i % 3 === 0 ? "Fizz" : ""}${i % 5 === 0 ? "Buzz" : ""}` || i))
fizzBuzz(100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment