Skip to content

Instantly share code, notes, and snippets.

@mateusmlo
Last active February 25, 2019 19:40
Show Gist options
  • Select an option

  • Save mateusmlo/db7dca46b2418a3eee85488f73a87248 to your computer and use it in GitHub Desktop.

Select an option

Save mateusmlo/db7dca46b2418a3eee85488f73a87248 to your computer and use it in GitHub Desktop.

Revisions

  1. mateusmlo revised this gist Feb 25, 2019. No changes.
  2. mateusmlo revised this gist Feb 25, 2019. No changes.
  3. mateusmlo revised this gist Feb 25, 2019. No changes.
  4. mateusmlo created this gist Feb 25, 2019.
    9 changes: 9 additions & 0 deletions fizzbuzz.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    const checkFizzBuzz = n => {
    if (n % 3 === 0 && n % 5 === 0) return 'Fizz Buzz';
    if (n % 3 === 0) return 'Fizz';
    if (n % 5 === 0) return 'Buzz';
    return n;
    }

    const oneToHundred = [...Array(101).keys()].slice(1);
    const getFizzBuzz = oneToHundred.map(checkFizzBuzz);