Short and simple FizzBuzz

Short and simple FizzBuzz


Posted on Aug 5, 2015 in Javascript

Not my solution, but i love it’s simplicity

1
2
3
4
5
6
for (var i = 1; i <= 100; i++) {
    var result = '';
    if (i % 3 === 0) result += 'Fizz';
    if (i % 5 === 0) result += 'Buzz';
    console.log(result || i);
}
Read More