Created
October 12, 2021 16:04
-
-
Save vexdy/bf38363d06343c5cf0e935b6e3602066 to your computer and use it in GitHub Desktop.
FizzBuzz One Liner
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
// This is the way it comes to my mind in 10 seconds, | |
// there are should be better ways to do it faster but | |
// I want to make this as a one liner sooo.. yeah! | |
for(let i=1;i<101;i++){console.log((i%3==0&&i%15!==0)?'fizz':(i%5==0&&i%15!==0)?'buzz':i%15==0?'fizzbuzz':'')} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment