Created
December 16, 2013 10:28
-
-
Save kasperlewau/7985015 to your computer and use it in GitHub Desktop.
randomz
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 arr (i) { return i ? arr(i-1).concat(i) : [] } | |
_.each(arr(100), function (x) { | |
console.log((x % 3 === 0 ? 'Fizz' : '')+(x % 5 === 0 ? 'Buzz' : '') || x); | |
}); |
Author
kasperlewau
commented
Dec 6, 2016
for (i of src) {
const f = i % 3 == 0;
const b = i % 5 == 0;
console.log(f && b ? 'fizzbuzz' : f ? 'fizz' : b ? 'buzz' : i)
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment