3 ms·
I came up with for(i=0;i<100;)console.log((++i%3?"":"Fizz")+(i%5?"":"Buzz")||i) earlier. 64 characters, because I don't have "var ", an extra set of paren
by xymostech 14y ago
I came up with
for(i=0;i<100;)console.log((++i%3?"":"Fizz")+(i%5?"":"Buzz")||i)
earlier. 64 characters, because I don't have "var ", an extra set of parens, and a semicolon. Worse syntax, but hey, it's code golf.
- Hupo 14y agoI knew I could also drop the "var ", but I like to operate within the 140bytes challenge rules that say you're not allowed to leak into the global scope. I'll give you the 3 chars from the parens and semicolon, though - I got caught up with the idea of "hey, you can do this whole thing inside the for statement itself!" back when I did this!
- deleted 14y ago[deleted]
- tobr 14y agoMine was almost identical, except with i++<100 instead of ++i%3? etc. Also 64 characters. But is there really no way to end the ternary operators without parenthesis?