Skip to content

Instantly share code, notes, and snippets.

@silesky
Created August 18, 2017 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save silesky/75b8d5d1ed3c7349fc8932308d71b456 to your computer and use it in GitHub Desktop.
Save silesky/75b8d5d1ed3c7349fc8932308d71b456 to your computer and use it in GitHub Desktop.
[...Array(101)].map((_, i) => {
const divBy = num => i % num === 0;
const w = word => `${i}...${word}`;
const output =
divBy(5) && divBy(7) && w`fizzbuzz` ||
divBy(5) && w`fizz` ||
divBy(7) && w`buzz` ||
w``;
output && console.log(output);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment