Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ukmadlz
Created March 6, 2018 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ukmadlz/f6c1f5f72ccf915fea4d9cab69e8e742 to your computer and use it in GitHub Desktop.
Save ukmadlz/f6c1f5f72ccf915fea4d9cab69e8e742 to your computer and use it in GitHub Desktop.
FizzBuzz without a for and on one line
console.log([...Array(100).keys()].map(function (i) { return i % 3 === 0 && i % 5 === 0 ? 'FizzBuzz' : i % 3 === 0 ? 'Fizz' : i % 5 === 0 ? 'Buzz' : i; }));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment