Created
February 14, 2018 00:08
-
-
Save joedski/f839024a668c003264c81b1f5f99e4da to your computer and use it in GitHub Desktop.
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
function fizzbuzz(max) { | |
for (let i = 1; i <= max; ++i) | |
console.log(i, `${!(i % 3) ? 'fizz' : ''}${!(i % 5) ? 'buzz' : ''}` || '.'); | |
} | |
function fizzbuzz(max) { | |
for (let i = 1; i <= max; ++i) | |
console.log(i, ((!(i % 3) ? 'fizz' : '') + (!(i % 5) ? 'buzz' : '')) || '.'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment