Skip to content

Instantly share code, notes, and snippets.

@morganwilde
Created December 28, 2017 16:33
Show Gist options
  • Save morganwilde/2bdd37f21042cfc891c593f58f9277a5 to your computer and use it in GitHub Desktop.
Save morganwilde/2bdd37f21042cfc891c593f58f9277a5 to your computer and use it in GitHub Desktop.
fizz({
messages: [
{message: 'fizz', value: 3},
{message: 'buzz', value: 5},
{message: 'fizzbuzz', value: 15},
{message: 'bar', value: 11}
],
sequenceFrom: 1,
sequenceTo: 11,
test: (number, value) => number % value === 0
});
// Should print:
// 1
// 2
// fizz
// 4
// buzz
// fizz
// 7
// 8
// fizz
// buzz
// bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment