Last active
August 1, 2019 09:46
-
-
Save emmanuelnk/82d50eb6d3aa9d23303704b4312c33ed to your computer and use it in GitHub Desktop.
FizzBuzz but with ES6!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fizzbuzz = (min, max) => new Array(max-min+1) | |
.fill(0) | |
.map((f,i) => console.log(`${((i+1)%3 === 0) ? 'fizz' : ''}${((i+1)%5 === 0) ? 'buzz' : ''}` || i+1)) | |
fizzbuzz(1, 100) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment