#JavaScript, 65 bytes
JavaScript, 65 bytes
for(i=0;i++<100;console.log((i%3?'':'Fizz')+(i%5?'':'Buzz')||i));
The shortest approach I've found yet. Perhaps there's a better one; suggestions are welcome. This was originally flagged ES6, but this works in ES5, and to my knowledge there's not a shorter way with ES6 features.
Here's another attempt, using .slice and some complicated maths for a total of 66 bytes:
for(i=0;i++<100;console.log('FizzBuzz'.slice(i%3&&4,i%5?4:8)||i));
(Thanks to Ben Fortune for a couple of handy tricks!)
#JavaScript, 65 bytes
for(i=0;i++<100;console.log((i%3?'':'Fizz')+(i%5?'':'Buzz')||i));
The shortest approach I've found yet. Perhaps there's a better one; suggestions are welcome. This was originally flagged ES6, but this works in ES5, and to my knowledge there's not a shorter way with ES6 features.
Here's another attempt, using .slice and some complicated maths for a total of 66 bytes:
for(i=0;i++<100;console.log('FizzBuzz'.slice(i%3&&4,i%5?4:8)||i));
(Thanks to Ben Fortune for a couple of handy tricks!)
JavaScript, 65 bytes
for(i=0;i++<100;console.log((i%3?'':'Fizz')+(i%5?'':'Buzz')||i));
The shortest approach I've found yet. Perhaps there's a better one; suggestions are welcome. This was originally flagged ES6, but this works in ES5, and to my knowledge there's not a shorter way with ES6 features.
Here's another attempt, using .slice and some complicated maths for a total of 66 bytes:
for(i=0;i++<100;console.log('FizzBuzz'.slice(i%3&&4,i%5?4:8)||i));
(Thanks to Ben Fortune for a couple of handy tricks!)
#JavaScript, 65 bytes
for(i=0;i++<100;console.log((i%3?'':'Fizz')+(i%5?'':'Buzz')||i));
The shortest approach I've found yet. Perhaps there's a better one; suggestions are welcome. This was originally flagged ES6, but this works in ES5, and to my knowledge there's not a shorter way with ES6 features.
Here's another attempt, using .substringslice and some complicated maths for a total of 66 bytes:
for(i=0;i++<100;console.log('FizzBuzz'.substringslice(i%3?4:0i%3&&4,i%5?4:8)||i));
(Thanks to Ben Fortune for a couple of handy tricks!)
#JavaScript, 65 bytes
for(i=0;i++<100;console.log((i%3?'':'Fizz')+(i%5?'':'Buzz')||i));
The shortest approach I've found yet. Perhaps there's a better one; suggestions are welcome. This was originally flagged ES6, but this works in ES5, and to my knowledge there's not a shorter way with ES6 features.
Here's another attempt, using .substring and some complicated maths:
for(i=0;i++<100;console.log('FizzBuzz'.substring(i%3?4:0,i%5?4:8)||i));
#JavaScript, 65 bytes
for(i=0;i++<100;console.log((i%3?'':'Fizz')+(i%5?'':'Buzz')||i));
The shortest approach I've found yet. Perhaps there's a better one; suggestions are welcome. This was originally flagged ES6, but this works in ES5, and to my knowledge there's not a shorter way with ES6 features.
Here's another attempt, using .slice and some complicated maths for a total of 66 bytes:
for(i=0;i++<100;console.log('FizzBuzz'.slice(i%3&&4,i%5?4:8)||i));
(Thanks to Ben Fortune for a couple of handy tricks!)
#Javascript#JavaScript, 65 bytes
for(i=0;i++<100;console.log((i%3?'':'Fizz')+(i%5?'':'Buzz')||i));
The shortest approach I've found yet. Perhaps there's a better one; suggestions are welcome. This was originally flagged ES6, but this works in ES5, and to my knowledge there's not a shorter way with ES6 features.
Here's another attempt, using .substring and some complicated maths:
for(i=0;i++<100;console.log('FizzBuzz'.substring(i%3?4:0,i%5?4:8)||i));
#Javascript, 65 bytes
for(i=0;i++<100;console.log((i%3?'':'Fizz')+(i%5?'':'Buzz')||i));
The shortest approach I've found yet. Perhaps there's a better one; suggestions are welcome. This was originally flagged ES6, but this works in ES5, and to my knowledge there's not a shorter way with ES6 features.
#JavaScript, 65 bytes
for(i=0;i++<100;console.log((i%3?'':'Fizz')+(i%5?'':'Buzz')||i));
The shortest approach I've found yet. Perhaps there's a better one; suggestions are welcome. This was originally flagged ES6, but this works in ES5, and to my knowledge there's not a shorter way with ES6 features.
Here's another attempt, using .substring and some complicated maths:
for(i=0;i++<100;console.log('FizzBuzz'.substring(i%3?4:0,i%5?4:8)||i));