Created
September 1, 2020 07:14
-
-
Save chregon/7a47eda72e1234cdaf5aa00bd7869bb8 to your computer and use it in GitHub Desktop.
Fizzbuzz but can i do FP?
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
[...Array(30).keys()].forEach(x => console.log(((x % 3 === 0) ? (x % 5 === 0 ? "fizzbuzz" : "fizz") : ((x % 5 == 0) ? "buzz" : x)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Outputs:
fizzbuzz
1
2
fizz
4
buzz
fizz
7
8
fizz
buzz
11
fizz
13
14
fizzbuzz
16
17
fizz
19
buzz
fizz
22
23
fizz
buzz
26
fizz
28
29