maitrikjpatel
6/24/2015 - 12:13 AM

FizzBuzz

FizzBuzz

var i=0,f='fizz',b='buzz';
while(i<100){
    i=i+1;
    console.log( 0 === i%15 ? f+b : (0 === i%3 ? f : (0 === i%5 ? b : i)));
}

//-----------

for (var i = 1; i <= 100; i++) {
  var f = i % 3  ===  0, b = i % 5 ===  0;
  console.log(f ? b ? "FizzBuzz" : "Fizz" : b ? "Buzz" : i);
}