Last active
December 14, 2016 03:38
-
-
Save okisanjp/fd1907e2a78de4e63954b2dbafca98cb to your computer and use it in GitHub Desktop.
js.fizzbuzz.practice
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
console.clear(); | |
for(var i = 1; i <= 100; i++){ | |
console.log( | |
// confusing use of '!' | |
!(i % 15) && 'FizzBuzz' || | |
!(i % 5) && 'Buzz' || | |
!(i % 3) && 'Fizz' || | |
i | |
); | |
} |
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
console.clear(); | |
for(var i = 1; i <= 100; i++){ | |
console.log( | |
(i % 15 === 0 && 'FizzBuzz') || | |
(i % 5 === 0 && 'Buzz') || | |
(i % 3 === 0 && 'Fizz') || | |
i | |
); | |
} |
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
console.clear(); | |
for(var i = 1; i <= 100; i++){ | |
console.log( | |
// (笑) | |
!Boolean(i % 15) && 'FizzBuzz' || | |
!Boolean(i % 5) && 'Buzz' || | |
!Boolean(i % 3) && 'Fizz' || | |
i | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment