Created
October 6, 2022 01:17
-
-
Save Grubba27/c685237ff98cd12615189efb676ffa90 to your computer and use it in GitHub Desktop.
Impl of fizzbuzz
This file contains hidden or 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 l = [...Array(100).keys()]; | |
| const fizz = (n) => (n % 3 === 0 ? "Fizz" : ""); | |
| const buzz = (n) => (n % 5 === 0 ? "Buzz" : ""); | |
| const fizzBuzzSolver = (number) => | |
| `${fizz(number)}${buzz(number)}` || "Nenhum"; | |
| l.forEach((number) => console.log(`${number}: ${fizzBuzzSolver(number)}`)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment