Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
FizzBuzz JavaScript solution
for (var i=1; i <= 20; i++)
{
if (i % 15 == 0)
console.log("FizzBuzz");
else if (i % 3 == 0)
console.log("Fizz");
else if (i % 5 == 0)
console.log("Buzz");
else
console.log(i);
}
@paulirish

This comment has been minimized.

Show comment
Hide comment
@paulirish

paulirish Mar 5, 2013

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);
}
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);
}
@Alexander-0x80

This comment has been minimized.

Show comment
Hide comment
@Alexander-0x80

Alexander-0x80 Jul 18, 2013

for(var i=1;i<=100;i++, msg=""){
    if (!(i%3)) msg+="Fizz"; 
    if (!(i%5)) msg+="Buzz"; 
    console.log(msg || i); 
}
for(var i=1;i<=100;i++, msg=""){
    if (!(i%3)) msg+="Fizz"; 
    if (!(i%5)) msg+="Buzz"; 
    console.log(msg || i); 
}
@giladaya

This comment has been minimized.

Show comment
Hide comment
@giladaya

giladaya Jul 18, 2013

// http://en.wikipedia.org/wiki/Precomputation
var vals = [1, 2, "Fizz", 4, "Buzz", "Fizz", 7, 8, "Fizz", "Buzz", 11, "Fizz", 13, 14, "FizzBuzz", 16, 17, "Fizz", 19, "Buzz", "Fizz", 22, 23, "Fizz", "Buzz", 26, "Fizz", 28, 29, "FizzBuzz", 31, 32, "Fizz", 34, "Buzz", "Fizz", 37, 38, "Fizz", "Buzz", 41, "Fizz", 43, 44, "FizzBuzz", 46, 47, "Fizz", 49, "Buzz", "Fizz", 52, 53, "Fizz", "Buzz", 56, "Fizz", 58, 59, "FizzBuzz", 61, 62, "Fizz", 64, "Buzz", "Fizz", 67, 68, "Fizz", "Buzz", 71, "Fizz", 73, 74, "FizzBuzz", 76, 77, "Fizz", 79, "Buzz", "Fizz", 82, 83, "Fizz", "Buzz", 86, "Fizz", 88, 89, "FizzBuzz", 91, 92, "Fizz", 94, "Buzz", "Fizz", 97, 98, "Fizz", "Buzz"];
for(var i=1, len=res.length; i<len; i++){
  console.log(res[i]);
}
// http://en.wikipedia.org/wiki/Precomputation
var vals = [1, 2, "Fizz", 4, "Buzz", "Fizz", 7, 8, "Fizz", "Buzz", 11, "Fizz", 13, 14, "FizzBuzz", 16, 17, "Fizz", 19, "Buzz", "Fizz", 22, 23, "Fizz", "Buzz", 26, "Fizz", 28, 29, "FizzBuzz", 31, 32, "Fizz", 34, "Buzz", "Fizz", 37, 38, "Fizz", "Buzz", 41, "Fizz", 43, 44, "FizzBuzz", 46, 47, "Fizz", 49, "Buzz", "Fizz", 52, 53, "Fizz", "Buzz", 56, "Fizz", 58, 59, "FizzBuzz", 61, 62, "Fizz", 64, "Buzz", "Fizz", 67, 68, "Fizz", "Buzz", 71, "Fizz", 73, 74, "FizzBuzz", 76, 77, "Fizz", 79, "Buzz", "Fizz", 82, 83, "Fizz", "Buzz", 86, "Fizz", 88, 89, "FizzBuzz", 91, 92, "Fizz", 94, "Buzz", "Fizz", 97, 98, "Fizz", "Buzz"];
for(var i=1, len=res.length; i<len; i++){
  console.log(res[i]);
}
@mobz

This comment has been minimized.

Show comment
Hide comment
@mobz

mobz Aug 8, 2013

// smallest?
for(i=0;i<100;)console.log((++i%3?'':'Fizz')+(i%5?'':'Buzz')||i)

mobz commented Aug 8, 2013

// smallest?
for(i=0;i<100;)console.log((++i%3?'':'Fizz')+(i%5?'':'Buzz')||i)
@rhka

This comment has been minimized.

Show comment
Hide comment
@rhka

rhka Jul 27, 2014

Excellent guys!

really smallest mobz :)

rhka commented Jul 27, 2014

Excellent guys!

really smallest mobz :)

@thetwit4u

This comment has been minimized.

Show comment
Hide comment
@thetwit4u

thetwit4u Jan 7, 2015

// And this the fastest ;) Even versus the precomputed.
// http://jsperf.com/fizzbuzz-arraymapvsprecomputevsforv3

console.log(
Array.apply(0, Array(100)).map(function (x, y) {
var nb = y+1;
var isFizz = ((nb % 3) == 0);
var isBuzz = ((nb % 5) == 0);
var isFizzBuzz = (isFizz && isBuzz);
if (isFizzBuzz) return 'fizzbuzz';
if (isFizz) return 'fizz';
if (isBuzz) return 'buzz';
return(nb);
}).join("\n"));

// And this the fastest ;) Even versus the precomputed.
// http://jsperf.com/fizzbuzz-arraymapvsprecomputevsforv3

console.log(
Array.apply(0, Array(100)).map(function (x, y) {
var nb = y+1;
var isFizz = ((nb % 3) == 0);
var isBuzz = ((nb % 5) == 0);
var isFizzBuzz = (isFizz && isBuzz);
if (isFizzBuzz) return 'fizzbuzz';
if (isFizz) return 'fizz';
if (isBuzz) return 'buzz';
return(nb);
}).join("\n"));

@SeeThruHead

This comment has been minimized.

Show comment
Hide comment
@SeeThruHead

SeeThruHead Jan 20, 2015

console.log(
  Array.apply(null, {length: 100}).map(function(val, index) {
    return (++index%3?'':'Fizz')+(index%5?'':'Buzz')||index;
  }).join('\n')
);

Faster?

console.log(
  Array.apply(null, {length: 100}).map(function(val, index) {
    index++;
    if (index % 15 == 0){return "FizzBuzz";}
    if (index % 3 == 0){return "Fizz";}
    if (index % 5 == 0){return "Buzz";}
    return index;
  }).join('\n')
);
console.log(
  Array.apply(null, {length: 100}).map(function(val, index) {
    return (++index%3?'':'Fizz')+(index%5?'':'Buzz')||index;
  }).join('\n')
);

Faster?

console.log(
  Array.apply(null, {length: 100}).map(function(val, index) {
    index++;
    if (index % 15 == 0){return "FizzBuzz";}
    if (index % 3 == 0){return "Fizz";}
    if (index % 5 == 0){return "Buzz";}
    return index;
  }).join('\n')
);
@angvishvish

This comment has been minimized.

Show comment
Hide comment
@angvishvish

angvishvish Feb 20, 2015

var check = function (number) {
      var fizz = number % 3 == 0, buzz = number % 5 == 0;
      console.log(fizz ? buzz ? "FizzBuzz" : "Fizz" : buzz ? "Buzz" : number);
      if (number != 0) { return check(number - 1);}
} check(100);
var check = function (number) {
      var fizz = number % 3 == 0, buzz = number % 5 == 0;
      console.log(fizz ? buzz ? "FizzBuzz" : "Fizz" : buzz ? "Buzz" : number);
      if (number != 0) { return check(number - 1);}
} check(100);
@dstop75

This comment has been minimized.

Show comment
Hide comment
@dstop75

dstop75 Feb 22, 2015

var i, values = [, , 'fizz', , 'buzz', 'fizz', , , 'fizz', 'buzz', , 'fizz', , , 'fizzbuzz'];

for (i = 0; i < 100; console.log(values[i++ % 15] || i));

dstop75 commented Feb 22, 2015

var i, values = [, , 'fizz', , 'buzz', 'fizz', , , 'fizz', 'buzz', , 'fizz', , , 'fizzbuzz'];

for (i = 0; i < 100; console.log(values[i++ % 15] || i));
@fernandocamargo

This comment has been minimized.

Show comment
Hide comment
@fernandocamargo

fernandocamargo Mar 1, 2015

(function (window) {
    'use strict';
    var counter = 1;
    var limit = 100;
    var options = {
      3: 'Fizz',
      5: 'Buzz',
      'default': function (input) {
        return input;
      }
    };

    var noop = function () {
      return;
    };

    var print = function (input) {
      var output = [];
      Object.keys(options).map(
        function (key) {
          (((typeof options[key] !== 'function') && ((parseInt(input, 10) % parseInt(key, 10)) === 0)) ? Array.prototype.push : noop).call(output, options[key]);
        }
      );
      return console.log.call(console, output.length ? output.join('') : options.default.call(this, input));
    };

    for (; counter <= limit; counter += 1) {
      print.call(this, counter);
    }
})(this);
(function (window) {
    'use strict';
    var counter = 1;
    var limit = 100;
    var options = {
      3: 'Fizz',
      5: 'Buzz',
      'default': function (input) {
        return input;
      }
    };

    var noop = function () {
      return;
    };

    var print = function (input) {
      var output = [];
      Object.keys(options).map(
        function (key) {
          (((typeof options[key] !== 'function') && ((parseInt(input, 10) % parseInt(key, 10)) === 0)) ? Array.prototype.push : noop).call(output, options[key]);
        }
      );
      return console.log.call(console, output.length ? output.join('') : options.default.call(this, input));
    };

    for (; counter <= limit; counter += 1) {
      print.call(this, counter);
    }
})(this);
@soundyogi

This comment has been minimized.

Show comment
Hide comment
@soundyogi

soundyogi Mar 5, 2015

Not short or fast or anything special ... but I think it's pretty <3

(function fizzBuzz(iter){
    var str = '';


    if(!(iter % 3)) str += 'Fizz'
    if(!(iter % 5)) str += 'Buzz'


    console.log(str || iter)


    if(iter >= 100) return


    fizzBuzz(++iter)
})(1)

Not short or fast or anything special ... but I think it's pretty <3

(function fizzBuzz(iter){
    var str = '';


    if(!(iter % 3)) str += 'Fizz'
    if(!(iter % 5)) str += 'Buzz'


    console.log(str || iter)


    if(iter >= 100) return


    fizzBuzz(++iter)
})(1)
@arei

This comment has been minimized.

Show comment
Hide comment
@arei

arei Mar 9, 2015

for (var i=0;i<=100;i++) console.log(!(i%15)&&"fizzbuzz"||!(i%5)&&"buzz"||!(i%3)&&"fizz"||i);

arei commented Mar 9, 2015

for (var i=0;i<=100;i++) console.log(!(i%15)&&"fizzbuzz"||!(i%5)&&"buzz"||!(i%3)&&"fizz"||i);

@dotch

This comment has been minimized.

Show comment
Hide comment
@dotch

dotch Mar 14, 2015

// even shorter
for(i=0;++i<101;console.log(i%5?x||i:x+'Buzz'))x=i%3?'':'Fizz'

dotch commented Mar 14, 2015

// even shorter
for(i=0;++i<101;console.log(i%5?x||i:x+'Buzz'))x=i%3?'':'Fizz'
@AdrianVelazquez

This comment has been minimized.

Show comment
Hide comment
@AdrianVelazquez

AdrianVelazquez Mar 27, 2015

for(i = 0; i <= 20; i++){
if(i % 3 == 0 && i % 5 == 0){
console.log("fizzBuzz");
}else if(i % 3 == 0){
console.log("fizz");
}else if(i % 5 == 0){
console.log("buzz");
}else{
console.log(i);
};

};

for(i = 0; i <= 20; i++){
if(i % 3 == 0 && i % 5 == 0){
console.log("fizzBuzz");
}else if(i % 3 == 0){
console.log("fizz");
}else if(i % 5 == 0){
console.log("buzz");
}else{
console.log(i);
};

};

@sintaxi

This comment has been minimized.

Show comment
Hide comment
@sintaxi

sintaxi May 12, 2015

felt obligated to contribute...

for (var i=1; i<=100; i++)(function(i){
  var output = ""

  if (i % 3 == 0)
   output += "Fizz"

  if (i % 5 == 0)
   output += "Buzz"

  console.log(output || i)
})(i)

sintaxi commented May 12, 2015

felt obligated to contribute...

for (var i=1; i<=100; i++)(function(i){
  var output = ""

  if (i % 3 == 0)
   output += "Fizz"

  if (i % 5 == 0)
   output += "Buzz"

  console.log(output || i)
})(i)
@cornedor

This comment has been minimized.

Show comment
Hide comment
@cornedor

cornedor May 12, 2015

Using a Generator

function * fizzBuzz() {

    var i = 0;
    while (true) {
        ++i;
        var x = 0;
        if (i % 3 === 0 && i % 5 === 0) yield 'Fizz Buzz';
        else if (i % 3 === 0) yield 'Fizz';
        else if (i % 5 === 0) yield 'Buzz';
        else yield i;
    }

}

var gen = fizzBuzz();
for (var i = 0; i < 100; i++) {
    console.log(gen.next().value + ' ');
}

Using a Generator

function * fizzBuzz() {

    var i = 0;
    while (true) {
        ++i;
        var x = 0;
        if (i % 3 === 0 && i % 5 === 0) yield 'Fizz Buzz';
        else if (i % 3 === 0) yield 'Fizz';
        else if (i % 5 === 0) yield 'Buzz';
        else yield i;
    }

}

var gen = fizzBuzz();
for (var i = 0; i < 100; i++) {
    console.log(gen.next().value + ' ');
}
@grabbou

This comment has been minimized.

Show comment
Hide comment
@grabbou

grabbou May 12, 2015

var fizzBuzz = function* () {
    var i = 0;
    do {
      const isFizz = i % 3 === 0;
      const isBuzz = i % 5 === 0;
      yield (isFizz ? isBuzz ? "FizzBuzz" : "Fizz" : isBuzz ? "Buzz" : i);
    } while (++i)
  }

var it = fizzBuzz();

for (let i = 0; i < 100; i++){
  console.log(it.next().value);
}

grabbou commented May 12, 2015

var fizzBuzz = function* () {
    var i = 0;
    do {
      const isFizz = i % 3 === 0;
      const isBuzz = i % 5 === 0;
      yield (isFizz ? isBuzz ? "FizzBuzz" : "Fizz" : isBuzz ? "Buzz" : i);
    } while (++i)
  }

var it = fizzBuzz();

for (let i = 0; i < 100; i++){
  console.log(it.next().value);
}
@technowar

This comment has been minimized.

Show comment
Hide comment
@technowar

technowar May 13, 2015

(function (){
    var array = [];

    for (var i = 1; i <= 100; i++) {
        array.push(i);

        if (i % 3 === 0) {
            array.splice(i - 1, 1, 'Fizz');
        }

        if (i % 5 === 0) {
            array.splice(i - 1, 1, 'Buzz');
        }

        if (i % 15 === 0) {
            array.splice(i - 1, 1, 'FizzBuzz');
        }
    }

    console.log(array);
})();
(function (){
    var array = [];

    for (var i = 1; i <= 100; i++) {
        array.push(i);

        if (i % 3 === 0) {
            array.splice(i - 1, 1, 'Fizz');
        }

        if (i % 5 === 0) {
            array.splice(i - 1, 1, 'Buzz');
        }

        if (i % 15 === 0) {
            array.splice(i - 1, 1, 'FizzBuzz');
        }
    }

    console.log(array);
})();
@0xadada

This comment has been minimized.

Show comment
Hide comment
@0xadada

0xadada May 13, 2015

// Concise
var f='Fizz', b='Buzz', i=0, d3, d5;
for (i; ++i <= 100; d3 = !(i % 3), d5 = !(i % 5), console.log(d3 ? d5 ? f+b : f : d5 ? b : i));

// Multi-line, commented
var               /* Declare our variables outside the loop, a performance best-practice */
    f='Fizz',     /* Variable `f` so we don't repeat 'Fizz' twice - DRY */
    b='Buzz',     /* Variable `b` so we don't repeat 'Buzz' twice - DRY */
    i=0,          /* For-loop counter, start at 0 */
    d3,           /* setup a variable for checking divisibility by 3 */
    d5;           /* setup a variable for checking divisibility by 5 */
for (                 /* Bodyless for loop */
    i;                /* Iterator on i */
    ++i <= 100;       /* ++i pre-increments to 1, stops at 100 */
    d3 = !(i % 3),    /* Logically we're testing for i%3 === 0 to be TRUE, indicating
                       * i is divisible by 3. Instead we test for 0, which also
                       * represents FALSE in Javascript. Use the ! NOT operator
                       * to coerce 0 to boolean value 1- which is TRUE. */
    d5 = !(i % 5),    /* Testing that NOT (i % 5) is TRUE using same logic as above */
    console.log(      /* ouput the result of a ternary operation to the console */
        d3 ?          /* was i divisible by 3? */
            d5 ?      /* was i divisible by 5? *? */
                f+b : /* Both conditions d3 and d5 are divisible TRUE: return string 'FizzBuzz': else */
            f :       /* only !(i%3) is true, just return string 'Fizz' */
        d5 ?          /* BOTH 3 AND 5 weren't divisible, was 5 divisible by itself TRUE? */
        b :           /* yes, return 'Buzz' */
        i             /* Nope, just return i */
    )                 /* end of console.log */
);                    /* end of for-loop */

0xadada commented May 13, 2015

// Concise
var f='Fizz', b='Buzz', i=0, d3, d5;
for (i; ++i <= 100; d3 = !(i % 3), d5 = !(i % 5), console.log(d3 ? d5 ? f+b : f : d5 ? b : i));

// Multi-line, commented
var               /* Declare our variables outside the loop, a performance best-practice */
    f='Fizz',     /* Variable `f` so we don't repeat 'Fizz' twice - DRY */
    b='Buzz',     /* Variable `b` so we don't repeat 'Buzz' twice - DRY */
    i=0,          /* For-loop counter, start at 0 */
    d3,           /* setup a variable for checking divisibility by 3 */
    d5;           /* setup a variable for checking divisibility by 5 */
for (                 /* Bodyless for loop */
    i;                /* Iterator on i */
    ++i <= 100;       /* ++i pre-increments to 1, stops at 100 */
    d3 = !(i % 3),    /* Logically we're testing for i%3 === 0 to be TRUE, indicating
                       * i is divisible by 3. Instead we test for 0, which also
                       * represents FALSE in Javascript. Use the ! NOT operator
                       * to coerce 0 to boolean value 1- which is TRUE. */
    d5 = !(i % 5),    /* Testing that NOT (i % 5) is TRUE using same logic as above */
    console.log(      /* ouput the result of a ternary operation to the console */
        d3 ?          /* was i divisible by 3? */
            d5 ?      /* was i divisible by 5? *? */
                f+b : /* Both conditions d3 and d5 are divisible TRUE: return string 'FizzBuzz': else */
            f :       /* only !(i%3) is true, just return string 'Fizz' */
        d5 ?          /* BOTH 3 AND 5 weren't divisible, was 5 divisible by itself TRUE? */
        b :           /* yes, return 'Buzz' */
        i             /* Nope, just return i */
    )                 /* end of console.log */
);                    /* end of for-loop */
@adamjgrant

This comment has been minimized.

Show comment
Hide comment
@adamjgrant

adamjgrant May 13, 2015

Shortest! And it doesn't print numbers when not divisible by 5 or 3 per the requirements.

x=0;while(x++<100)console.log((x%3?"":"fizz")+(x%5?"":"buzz"))

(62 characters)

http://codepen.io/ajkochanowicz/pen/XbdaaM

And if a "fizz buzz" format is acceptable you could do this

x=0;while(x++<100)console.log(x%3?"":"fizz",x%5?"":"buzz")

(58 characters)

Shortest! And it doesn't print numbers when not divisible by 5 or 3 per the requirements.

x=0;while(x++<100)console.log((x%3?"":"fizz")+(x%5?"":"buzz"))

(62 characters)

http://codepen.io/ajkochanowicz/pen/XbdaaM

And if a "fizz buzz" format is acceptable you could do this

x=0;while(x++<100)console.log(x%3?"":"fizz",x%5?"":"buzz")

(58 characters)

@adamjgrant

This comment has been minimized.

Show comment
Hide comment
@adamjgrant

adamjgrant May 14, 2015

Make that 61 characters...

for(x=0;x++<100;)console.log((x%3?"":"fizz")+(x%5?"":"buzz"))

or 57 characters...

for(x=0;x++<100;)console.log(x%3?"":"fizz",x%5?"":"buzz")

And if we're allowed to print numbers instead of ""

for(x=0;x++<100;)console.log(x%3||"fizz",x%5||"buzz")

(53 characters)

Make that 61 characters...

for(x=0;x++<100;)console.log((x%3?"":"fizz")+(x%5?"":"buzz"))

or 57 characters...

for(x=0;x++<100;)console.log(x%3?"":"fizz",x%5?"":"buzz")

And if we're allowed to print numbers instead of ""

for(x=0;x++<100;)console.log(x%3||"fizz",x%5||"buzz")

(53 characters)

@AlexFoster009

This comment has been minimized.

Show comment
Hide comment
@AlexFoster009

AlexFoster009 May 29, 2015

This might seem like a dumb question, but how would i append the result of the loop to the body element of the page?

my markup

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Fizz Buzz Challenge</title>
    <script src="http://code.jquery.com/jquery-2.1.4.min.js"> </script>
    <script src="script.js"> </script>
</head>
<body>





</body>
</html>

the script

var i;


for( i = 1; i <= 100; i++){


    if (  i % 15 == 0) {

        console.log('Fizz Buzz')

    }else if (i % 5 == 0) {

        console.log('buzz');

    }else if (i % 3 == 0) {



        console.log('Fizz');


    }else {


        console.log(i);
    }





}



Instead of console.log id like to have my results print into the body element so it is displayed on the page rather then in the console...its probably simple but im brand new to programming

This might seem like a dumb question, but how would i append the result of the loop to the body element of the page?

my markup

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Fizz Buzz Challenge</title>
    <script src="http://code.jquery.com/jquery-2.1.4.min.js"> </script>
    <script src="script.js"> </script>
</head>
<body>





</body>
</html>

the script

var i;


for( i = 1; i <= 100; i++){


    if (  i % 15 == 0) {

        console.log('Fizz Buzz')

    }else if (i % 5 == 0) {

        console.log('buzz');

    }else if (i % 3 == 0) {



        console.log('Fizz');


    }else {


        console.log(i);
    }





}



Instead of console.log id like to have my results print into the body element so it is displayed on the page rather then in the console...its probably simple but im brand new to programming

@tedgeving

This comment has been minimized.

Show comment
Hide comment
@tedgeving

tedgeving Jun 10, 2015

Below will append to the body, would need to use a query selector to place it somewhere specific.

Alternatively, results are appended to a div instead of body in this fiddle: https://jsfiddle.net/frpmz5jr/

for(var i = 1; i <=100; ++i){

 if(i % 15 === 0){

        // console.log('Fizz Buzz');
        document.write('Fizz Buzz');
        document.write('<br/>');

    }else if(i % 3 === 0){

        // console.log('Fizz');
        document.write('Fizz');
        document.write('<br/>');

    }else if(i % 5 === 0){

        // console.log('Buzz');
        document.write('Buzz');
        document.write('<br/>');

    }else{

        // console.log(i);
        document.write(i);
        document.write('<br/>');
    }
}

Below will append to the body, would need to use a query selector to place it somewhere specific.

Alternatively, results are appended to a div instead of body in this fiddle: https://jsfiddle.net/frpmz5jr/

for(var i = 1; i <=100; ++i){

 if(i % 15 === 0){

        // console.log('Fizz Buzz');
        document.write('Fizz Buzz');
        document.write('<br/>');

    }else if(i % 3 === 0){

        // console.log('Fizz');
        document.write('Fizz');
        document.write('<br/>');

    }else if(i % 5 === 0){

        // console.log('Buzz');
        document.write('Buzz');
        document.write('<br/>');

    }else{

        // console.log(i);
        document.write(i);
        document.write('<br/>');
    }
}

@omeiza

This comment has been minimized.

Show comment
Hide comment
@omeiza

omeiza Jul 4, 2015

I feel this is the most simplest and the best solution.

for (var i = 1; i <= 100; i++) { answer = " "; if (i % 3 == 0) { answer += 'Fizz'; } if (i % 5 == 0) { answer += 'Buzz'; } console.log(answer || i); }

omeiza commented Jul 4, 2015

I feel this is the most simplest and the best solution.

for (var i = 1; i <= 100; i++) { answer = " "; if (i % 3 == 0) { answer += 'Fizz'; } if (i % 5 == 0) { answer += 'Buzz'; } console.log(answer || i); }
@vrybas

This comment has been minimized.

Show comment
Hide comment
@vrybas

vrybas Jul 5, 2015

  1. Readability
  2. Readability
  3. Readability
  4. Extendability
  5. Performance
    ...
  6. Counting of LOC
FizzBuzz = function() {
  var length = 100,
      result = new Array(length);

  for (i=0; i < length; i++) {
    var seqNum     = i + 1,
        div3       = ((seqNum % 3) === 0),
        div5       = ((seqNum % 5) === 0),

        isFizzy    = div3,
        isBuzzy    = !div3 && div5,
        isFizBuzzy = div3 && div5,

        word;

    if (isFizzy)    { word = "Fizz" };
    if (isBuzzy)    { word = "Buzz" };
    if (isFizBuzzy) { word = "FizzBuzz" };

    result[i] = word || seqNum;
    word = null;
  }

  return result;
}

FizzBuzz().forEach( function(elm) { console.log(elm) });

vrybas commented Jul 5, 2015

  1. Readability
  2. Readability
  3. Readability
  4. Extendability
  5. Performance
    ...
  6. Counting of LOC
FizzBuzz = function() {
  var length = 100,
      result = new Array(length);

  for (i=0; i < length; i++) {
    var seqNum     = i + 1,
        div3       = ((seqNum % 3) === 0),
        div5       = ((seqNum % 5) === 0),

        isFizzy    = div3,
        isBuzzy    = !div3 && div5,
        isFizBuzzy = div3 && div5,

        word;

    if (isFizzy)    { word = "Fizz" };
    if (isBuzzy)    { word = "Buzz" };
    if (isFizBuzzy) { word = "FizzBuzz" };

    result[i] = word || seqNum;
    word = null;
  }

  return result;
}

FizzBuzz().forEach( function(elm) { console.log(elm) });
@Azimoto9

This comment has been minimized.

Show comment
Hide comment
@Azimoto9

Azimoto9 Jul 13, 2015

var fizz = 'Fizz';
var buzz = 'Buzz';

var fizzbuzz5 = function(j) {
if(j % 5 === 0) {
console.log(fizz + buzz);
}
else {
console.log(fizz);
}};

var fizzbuzz3 = function(k) {
if(k % 3 === 0) {
console.log(fizz + buzz);
}
else {
console.log(buzz);
};

};
for(i=1; i <= 100; i++) {

if(i % 3 === 0) {
    fizzbuzz5(i);
}
else if(i % 5 === 0) {
    fizzbuzz3(i);
}
else {
    console.log(i);
};

};

var fizz = 'Fizz';
var buzz = 'Buzz';

var fizzbuzz5 = function(j) {
if(j % 5 === 0) {
console.log(fizz + buzz);
}
else {
console.log(fizz);
}};

var fizzbuzz3 = function(k) {
if(k % 3 === 0) {
console.log(fizz + buzz);
}
else {
console.log(buzz);
};

};
for(i=1; i <= 100; i++) {

if(i % 3 === 0) {
    fizzbuzz5(i);
}
else if(i % 5 === 0) {
    fizzbuzz3(i);
}
else {
    console.log(i);
};

};

@wiafe

This comment has been minimized.

Show comment
Hide comment
@wiafe

wiafe Jul 15, 2015

Here is mine!

for (var i = 1; i <= 100; i++) {
  if (i % 3 === 0) {
      console.log( i + " = " + "Fizz");
  }else if (i % 5 === 0) {
      console.log( i + " = " + "Buzz");
  }else {
      console.log(i);
  }
  if (i % 3 === 0 && i % 5 === 0) {
      console.log( i + " = " + "FizzBuzz");
  }
};

wiafe commented Jul 15, 2015

Here is mine!

for (var i = 1; i <= 100; i++) {
  if (i % 3 === 0) {
      console.log( i + " = " + "Fizz");
  }else if (i % 5 === 0) {
      console.log( i + " = " + "Buzz");
  }else {
      console.log(i);
  }
  if (i % 3 === 0 && i % 5 === 0) {
      console.log( i + " = " + "FizzBuzz");
  }
};
@jw56578

This comment has been minimized.

Show comment
Hide comment
@jw56578

jw56578 Jul 28, 2015


var func = null;
var conditions = {
    1:{true:null,
       false:function(i){
           return function(){console.log(i)};
       }},
    3:{true:function(){
        return func;
    },false:function(){
    return function(){console.log('fizz')};
    }},
    5:{true:function(){ return func;},false:function(){
        return function(){console.log('buzz')};
    }},
    15:{true:function(){ return func;},false:function(){
        return function(){console.log('fizzbuzz')};
    }}

}
var l = 100;
var words = [];
for(l = 1 ; l < 100 ; l ++){    
    for(var thing in conditions){
        var result = l % thing;
        func = conditions[thing][!!result](l);
    }
    func();
}

jw56578 commented Jul 28, 2015


var func = null;
var conditions = {
    1:{true:null,
       false:function(i){
           return function(){console.log(i)};
       }},
    3:{true:function(){
        return func;
    },false:function(){
    return function(){console.log('fizz')};
    }},
    5:{true:function(){ return func;},false:function(){
        return function(){console.log('buzz')};
    }},
    15:{true:function(){ return func;},false:function(){
        return function(){console.log('fizzbuzz')};
    }}

}
var l = 100;
var words = [];
for(l = 1 ; l < 100 ; l ++){    
    for(var thing in conditions){
        var result = l % thing;
        func = conditions[thing][!!result](l);
    }
    func();
}
@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Aug 12, 2015

for(var i = 1;i <= 100;i++){
if(i % 3 == 0) {console.log("Fizz");continue;}
if(i % 5 == 0) {console.log("Buzz");continue;}
if(i % 15 == 0) {console.log("FizzBuzz");continue;}
console.log(i);
}

ghost commented Aug 12, 2015

for(var i = 1;i <= 100;i++){
if(i % 3 == 0) {console.log("Fizz");continue;}
if(i % 5 == 0) {console.log("Buzz");continue;}
if(i % 15 == 0) {console.log("FizzBuzz");continue;}
console.log(i);
}

@ogur

This comment has been minimized.

Show comment
Hide comment
@ogur

ogur Aug 25, 2015

Object.keys(new Int8Array(100))
.map(x=>((++x%3==0)?f='fizz':x))
.map((x,i)=>((++i%5==0)?b='buzz':x))
.map((x,i)=>((++i%15===0)?f+b:x))

ogur commented Aug 25, 2015

Object.keys(new Int8Array(100))
.map(x=>((++x%3==0)?f='fizz':x))
.map((x,i)=>((++i%5==0)?b='buzz':x))
.map((x,i)=>((++i%15===0)?f+b:x))
@amahar

This comment has been minimized.

Show comment
Hide comment
@amahar

amahar Aug 27, 2015

for (var i=1; i < 100; i++){
var message = i; 
if (i%3 == 0 && i%5 == 0){`
    message = "FizzBuzz";
 } else if(i%5 == 0){
    message = "Buzz";
 } else if (i%3 == 0){
    message = "Fizz";
 }
 console.log('\n' + message + '\n');    
 };

amahar commented Aug 27, 2015

for (var i=1; i < 100; i++){
var message = i; 
if (i%3 == 0 && i%5 == 0){`
    message = "FizzBuzz";
 } else if(i%5 == 0){
    message = "Buzz";
 } else if (i%3 == 0){
    message = "Fizz";
 }
 console.log('\n' + message + '\n');    
 };
@newshorts

This comment has been minimized.

Show comment
Hide comment
@newshorts

newshorts Aug 28, 2015

if we are going to make things completely unreadable:

for(var i=1;100>=i;++i)console.log(i%15!==0?i%5!==0?i%3===0?"fizz":i:"buzz":"fizzbuzz");

if we are going to make things completely unreadable:

for(var i=1;100>=i;++i)console.log(i%15!==0?i%5!==0?i%3===0?"fizz":i:"buzz":"fizzbuzz");
@thomasmarren

This comment has been minimized.

Show comment
Hide comment
@thomasmarren

thomasmarren Sep 1, 2015

Tried to make it using a recursive function

function fizzBuzz(num){
    if (num % 3 === 0 && num % 5 === 0 ){
    console.log("FizzBuzz");
  } else if (num % 3 === 0) {
    console.log("Fizz");
  } else if (num % 5 === 0){
    console.log("Buzz");
  } else {
    console.log(num);
  }

  if (num < 100){
  var newNumber = num + 1;
  fizzBuzz(newNumber);
  }
};

fizzBuzz(1);

Tried to make it using a recursive function

function fizzBuzz(num){
    if (num % 3 === 0 && num % 5 === 0 ){
    console.log("FizzBuzz");
  } else if (num % 3 === 0) {
    console.log("Fizz");
  } else if (num % 5 === 0){
    console.log("Buzz");
  } else {
    console.log(num);
  }

  if (num < 100){
  var newNumber = num + 1;
  fizzBuzz(newNumber);
  }
};

fizzBuzz(1);
@barry-hall

This comment has been minimized.

Show comment
Hide comment
@barry-hall

barry-hall Sep 3, 2015

function fizzBuzz(range) {
    for(var i = 0; i <= range; i++) {
        var fizz = Boolean = i % 3 == 0;
        var buzz = Boolean = i % 5 == 0;

        if(fizz && buzz)
            console.log("fizzbuzz");
        else if(fizz)
            console.log("fizz");
        else if(buzz)
            console.log("buzz");
        else 
            console.log(i);
    }
} 

fizzBuzz(100); 
function fizzBuzz(range) {
    for(var i = 0; i <= range; i++) {
        var fizz = Boolean = i % 3 == 0;
        var buzz = Boolean = i % 5 == 0;

        if(fizz && buzz)
            console.log("fizzbuzz");
        else if(fizz)
            console.log("fizz");
        else if(buzz)
            console.log("buzz");
        else 
            console.log(i);
    }
} 

fizzBuzz(100); 
@markogresak

This comment has been minimized.

Show comment
Hide comment
@markogresak

markogresak Sep 13, 2015

  • "1 sloc" (single chained statement)
  • no ifs and no ternary (some short circuiting "magic")
console.log(
  Array.apply(undefined, {length: 20})
    .map(function(_i, i) { 
      return ((++i % 3 === 0 && 'Fizz' || '') + (i % 5 === 0 && 'Buzz' || '')) || i
    })
    .join('\n')
)

Outer brackets at return could be removed but I decided to keep them for at least some readability.

  • "1 sloc" (single chained statement)
  • no ifs and no ternary (some short circuiting "magic")
console.log(
  Array.apply(undefined, {length: 20})
    .map(function(_i, i) { 
      return ((++i % 3 === 0 && 'Fizz' || '') + (i % 5 === 0 && 'Buzz' || '')) || i
    })
    .join('\n')
)

Outer brackets at return could be removed but I decided to keep them for at least some readability.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Oct 11, 2015

for(var i = 1;i <= 100;i++){
var str = "";
if(!(i%3))str += "Fizz";
if(!(i%5))str += "Buzz";
console.log(str || i);
}

ghost commented Oct 11, 2015

for(var i = 1;i <= 100;i++){
var str = "";
if(!(i%3))str += "Fizz";
if(!(i%5))str += "Buzz";
console.log(str || i);
}

@gridmechanic

This comment has been minimized.

Show comment
Hide comment
@gridmechanic

gridmechanic Nov 18, 2015

(function fizzBuzz () {
    for (i=1;i<101;i++){
        if (i % 15 === 0){
            console.log('FizzBuzz');
        } else if(i % 3 === 0) {
            console.log('Fizz');
        } else if (i % 5 === 0  ){
            console.log('Buzz');
        }
        else {
            console.log(i);
        }
    };
})();
(function fizzBuzz () {
    for (i=1;i<101;i++){
        if (i % 15 === 0){
            console.log('FizzBuzz');
        } else if(i % 3 === 0) {
            console.log('Fizz');
        } else if (i % 5 === 0  ){
            console.log('Buzz');
        }
        else {
            console.log(i);
        }
    };
})();
@jaichandra

This comment has been minimized.

Show comment
Hide comment
@jaichandra

jaichandra Nov 19, 2015

for(var i=1; i<=15; i++) {
  console.log(i%3 ? i%5 ? i : 'buzz' : i%5 ? 'fizz' : 'fizzbuzz');
}
for(var i=1; i<=15; i++) {
  console.log(i%3 ? i%5 ? i : 'buzz' : i%5 ? 'fizz' : 'fizzbuzz');
}
@nathanhornby

This comment has been minimized.

Show comment
Hide comment
@nathanhornby

nathanhornby Dec 5, 2015

My take, balancing readability with brevity!

for ( i=1; i<=100; i++ ) {
  var mod3   = i%3 === 0,
      mod5   = i%5 === 0,
      result = mod3 && mod5 ? 'fizzbuzz' : mod3 ? 'fizz' : mod5 ? 'buzz' : i;

  console.log( result );
}

My take, balancing readability with brevity!

for ( i=1; i<=100; i++ ) {
  var mod3   = i%3 === 0,
      mod5   = i%5 === 0,
      result = mod3 && mod5 ? 'fizzbuzz' : mod3 ? 'fizz' : mod5 ? 'buzz' : i;

  console.log( result );
}
@emaraosman

This comment has been minimized.

Show comment
Hide comment
@emaraosman

emaraosman Dec 12, 2015

Here's a long one using while:

var counter = 0
while (counter<100){
    counter=counter+1;
    if (counter%3==0 && counter%5==0)
        console.log("FizzBuzz");
    else if(counter%3==0)
        console.log("Fizz");
    else if(counter%5==0)
        console.log("Buzz");
    else
    console.log(counter);
}

Here's a long one using while:

var counter = 0
while (counter<100){
    counter=counter+1;
    if (counter%3==0 && counter%5==0)
        console.log("FizzBuzz");
    else if(counter%3==0)
        console.log("Fizz");
    else if(counter%5==0)
        console.log("Buzz");
    else
    console.log(counter);
}
@low-ghost

This comment has been minimized.

Show comment
Hide comment
@low-ghost

low-ghost Dec 16, 2015

ES7 array comprehension:

console.log(
  [ for (i of Array(100).keys())
    (++i % 3 ? '' : 'fizz') + (i % 5 ? '' : 'buzz') || i ].join('\n'));

ES7 array comprehension:

console.log(
  [ for (i of Array(100).keys())
    (++i % 3 ? '' : 'fizz') + (i % 5 ? '' : 'buzz') || i ].join('\n'));
@PHRENESE

This comment has been minimized.

Show comment
Hide comment
@PHRENESE

PHRENESE Jan 7, 2016

Conscientious beginner:

function fizzbuzz(num, fizz, buzz) {    
 for (i = 1; i <= num; i++) {    
     if (i % (fizz * buzz) === 0) {
         console.log("FizzBuzz");
     } else if (i % buzz === 0) {
         console.log("Buzz");
     } else if (i % fizz === 0) {
         console.log("Fizz");
     }   
 }  
}    

fizzbuzz(100, 3, 5);

PHRENESE commented Jan 7, 2016

Conscientious beginner:

function fizzbuzz(num, fizz, buzz) {    
 for (i = 1; i <= num; i++) {    
     if (i % (fizz * buzz) === 0) {
         console.log("FizzBuzz");
     } else if (i % buzz === 0) {
         console.log("Buzz");
     } else if (i % fizz === 0) {
         console.log("Fizz");
     }   
 }  
}    

fizzbuzz(100, 3, 5);
@JAMesserman

This comment has been minimized.

Show comment
Hide comment
@JAMesserman

JAMesserman Jan 8, 2016

function alertFizzBuzz(numrange){
    var result = [];
    for (var i = 1; i<=numrange; i++){
        result.push(fizzOrBuzz(i));
    }
    alert(result.join(','));
}
function fizzOrBuzz(num){
    if (num % 3 === 0){
        if (num % 5 === 0){
            return 'FizzBuzz';
        }
        return 'Fizz';
    }
    if (num % 5 === 0){
        return 'Buzz';
    }
    return num;
}
alertFizzBuzz(100);
function alertFizzBuzz(numrange){
    var result = [];
    for (var i = 1; i<=numrange; i++){
        result.push(fizzOrBuzz(i));
    }
    alert(result.join(','));
}
function fizzOrBuzz(num){
    if (num % 3 === 0){
        if (num % 5 === 0){
            return 'FizzBuzz';
        }
        return 'Fizz';
    }
    if (num % 5 === 0){
        return 'Buzz';
    }
    return num;
}
alertFizzBuzz(100);
@Jurtly

This comment has been minimized.

Show comment
Hide comment
@Jurtly

Jurtly Jan 13, 2016

you most probably have it right, you just need to place the AND operators first! Thank you for all the help in here!!!

for (i = 1; i <= 20; i++) {
if ( i % 5 === 0 && i % 3 ===0 ) {
console.log("FizzBuzz");
} else if( i % 5 === 0) {
console.log("Buzz");
} else if ( i % 3 === 0) {
console.log("Fizz");
} else {
console.log(i);
}
};

Jurtly commented Jan 13, 2016

you most probably have it right, you just need to place the AND operators first! Thank you for all the help in here!!!

for (i = 1; i <= 20; i++) {
if ( i % 5 === 0 && i % 3 ===0 ) {
console.log("FizzBuzz");
} else if( i % 5 === 0) {
console.log("Buzz");
} else if ( i % 3 === 0) {
console.log("Fizz");
} else {
console.log(i);
}
};

@tomasz-nolberczak

This comment has been minimized.

Show comment
Hide comment
@tomasz-nolberczak

tomasz-nolberczak Jan 20, 2016

That was easy:

for (var i = 0; i < 100; i++) {
    if (i % 3 == 0 && i % 5 == 0) console.log("FizzBuzz: " + i);
    else if (i % 3 == 0 && i % 5 != 0) console.log("Fizz: " + i);
    else if (i % 5 == 0 && i % 3 != 0) console.log("Buzz: " + i);
}

That was easy:

for (var i = 0; i < 100; i++) {
    if (i % 3 == 0 && i % 5 == 0) console.log("FizzBuzz: " + i);
    else if (i % 3 == 0 && i % 5 != 0) console.log("Fizz: " + i);
    else if (i % 5 == 0 && i % 3 != 0) console.log("Buzz: " + i);
}
@Bytons

This comment has been minimized.

Show comment
Hide comment
@Bytons

Bytons Jan 26, 2016

for(i = 0; i <= 100; i++){

if(i % 3 == 0 && i % 5 == 0){
console.log("fizzBuzz");
}else if(i % 3 == 0){
console.log("fizz");
}else if(i % 5 == 0){
console.log("buzz");
}else{
console.log(i);
};

};

Bytons commented Jan 26, 2016

for(i = 0; i <= 100; i++){

if(i % 3 == 0 && i % 5 == 0){
console.log("fizzBuzz");
}else if(i % 3 == 0){
console.log("fizz");
}else if(i % 5 == 0){
console.log("buzz");
}else{
console.log(i);
};

};
@samplefrequency

This comment has been minimized.

Show comment
Hide comment
@samplefrequency

samplefrequency Feb 2, 2016

var i;
for (i = 1; i <= 100; i++) {
console.log ((i % 3 === 0 || i % 5 === 0) ? (i % 3 === 0 ? 'fizz' : '') + (i % 5 === 0 ? 'buzz' : '') : i);
}

var i;
for (i = 1; i <= 100; i++) {
console.log ((i % 3 === 0 || i % 5 === 0) ? (i % 3 === 0 ? 'fizz' : '') + (i % 5 === 0 ? 'buzz' : '') : i);
}

@pdspicer

This comment has been minimized.

Show comment
Hide comment
@pdspicer

pdspicer Feb 3, 2016

var div = ((n, s) => i => i % n ? '' : s), f = div(3,'fizz'), b = div(5,'buzz'),
    fizzbuzz = i => i > 0 && fizzbuzz((i - 1)) || console.log(f(i) + b(i) || i);
fizzbuzz(100);

... or more generally:

var div = ((n, s) => i => i % n ? '' : s), f = div(3,'fizz'), b = div(5,'buzz'),
    loop = fn => i => i > 0 && loop(fn)(i - 1) || fn(i),
    fizzbuzz = loop(i => console.log(f(i) + b(i) || i));
fizzbuzz(100);

pdspicer commented Feb 3, 2016

var div = ((n, s) => i => i % n ? '' : s), f = div(3,'fizz'), b = div(5,'buzz'),
    fizzbuzz = i => i > 0 && fizzbuzz((i - 1)) || console.log(f(i) + b(i) || i);
fizzbuzz(100);

... or more generally:

var div = ((n, s) => i => i % n ? '' : s), f = div(3,'fizz'), b = div(5,'buzz'),
    loop = fn => i => i > 0 && loop(fn)(i - 1) || fn(i),
    fizzbuzz = loop(i => console.log(f(i) + b(i) || i));
fizzbuzz(100);
@jannatshah

This comment has been minimized.

Show comment
Hide comment
@jannatshah

jannatshah Apr 2, 2016

I'm a newbie to JS. Wrote this to return an array, tailored to a specific kata.

var i;
function fizzify(i) {
    if(i % 15 == 0) return 'FizzBuzz';    
    else if(i % 5 == 0) return 'Buzz';    
    else if(i % 3 == 0) return 'Fizz';    
    else return i;
};

function fizzbuzz(n) {
var fizzBuzz = [];
    for (i = 1; i <= n; i++ ) 
      {
      fizzBuzz.push(fizzify(i));
      };
    return fizzBuzz;
};

I'm a newbie to JS. Wrote this to return an array, tailored to a specific kata.

var i;
function fizzify(i) {
    if(i % 15 == 0) return 'FizzBuzz';    
    else if(i % 5 == 0) return 'Buzz';    
    else if(i % 3 == 0) return 'Fizz';    
    else return i;
};

function fizzbuzz(n) {
var fizzBuzz = [];
    for (i = 1; i <= n; i++ ) 
      {
      fizzBuzz.push(fizzify(i));
      };
    return fizzBuzz;
};
@isafrus5

This comment has been minimized.

Show comment
Hide comment
@isafrus5

isafrus5 Apr 10, 2016

for(var i = 1; i <= 100; i++) { if (i%3 === 0 && i % 5 !== 0) { console.log("Fizz"); } else if (i % 5 === 0 && i % 3 !== 0) { console.log("Buzz"); } else if (i % 5 === 0 && i % 3 === 0) { console.log("FizzBuzz"); } else { console.log(i); } }

for(var i = 1; i <= 100; i++) { if (i%3 === 0 && i % 5 !== 0) { console.log("Fizz"); } else if (i % 5 === 0 && i % 3 !== 0) { console.log("Buzz"); } else if (i % 5 === 0 && i % 3 === 0) { console.log("FizzBuzz"); } else { console.log(i); } }

@jdiss

This comment has been minimized.

Show comment
Hide comment
@jdiss

jdiss Apr 14, 2016

var arr = Array.apply(null, Array(100)).map(function (x,i) {
i++;
return ((i%3 === 0) && (i%5 === 0)) ? 'FizzBuzz' : (i%3 === 0) ?'Fizz' : (i%5 === 0) ? 'Buzz': i;
}).forEach(function(element) {
console.log(element);
});

jdiss commented Apr 14, 2016

var arr = Array.apply(null, Array(100)).map(function (x,i) {
i++;
return ((i%3 === 0) && (i%5 === 0)) ? 'FizzBuzz' : (i%3 === 0) ?'Fizz' : (i%5 === 0) ? 'Buzz': i;
}).forEach(function(element) {
console.log(element);
});

@LindsayBrown81

This comment has been minimized.

Show comment
Hide comment
@LindsayBrown81

LindsayBrown81 Apr 17, 2016

for (var i=1; i<=100; i++){ 
    (function FizzbuzzHelper(){ 
    var n = i;
        if (n%15==0){
            console.log("FizzBuzz");
        }
        else if (n%5==0){
            console.log("Buzz");
        }
        else if (n%3==0){                 
            console.log("Fizz");   
        }
        else{
            console.log(n);
        }
    })();
};
for (var i=1; i<=100; i++){ 
    (function FizzbuzzHelper(){ 
    var n = i;
        if (n%15==0){
            console.log("FizzBuzz");
        }
        else if (n%5==0){
            console.log("Buzz");
        }
        else if (n%3==0){                 
            console.log("Fizz");   
        }
        else{
            console.log(n);
        }
    })();
};
@paceaux

This comment has been minimized.

Show comment
Hide comment
@paceaux

paceaux Apr 19, 2016

 for (var f, b, i = 0; i < 101; i++) {
    f = !(i%3) ? 'fizz' : '';
    b = !(i%5) ? 'buzz' : '';
   console.log( (f + b) || i );
  }

paceaux commented Apr 19, 2016

 for (var f, b, i = 0; i < 101; i++) {
    f = !(i%3) ? 'fizz' : '';
    b = !(i%5) ? 'buzz' : '';
   console.log( (f + b) || i );
  }
@kaelig

This comment has been minimized.

Show comment
Hide comment
@kaelig

kaelig May 22, 2016

Looks like nobody proposed a solution using a switch, so here is one:

for (var index = 1; index <= 100; index++) {
    switch (true) {
        case (index % 3 === 0 && index % 5 === 0):
            console.log('FizzBuzz');
            break;

        case (index % 3 === 0):
            console.log('Fizz');
            break;

        case (index % 5 === 0):
            console.log('Buzz');
            break;

        default:
            console.log(index);
            break;
    }
}

kaelig commented May 22, 2016

Looks like nobody proposed a solution using a switch, so here is one:

for (var index = 1; index <= 100; index++) {
    switch (true) {
        case (index % 3 === 0 && index % 5 === 0):
            console.log('FizzBuzz');
            break;

        case (index % 3 === 0):
            console.log('Fizz');
            break;

        case (index % 5 === 0):
            console.log('Buzz');
            break;

        default:
            console.log(index);
            break;
    }
}
@renemonroy

This comment has been minimized.

Show comment
Hide comment
@renemonroy

renemonroy Jun 1, 2016

Short?

fizzBuzz=n=>isNaN(n)?!1:(n%3?'':'fizz')+(n%5?'':'buzz')||n

Short?

fizzBuzz=n=>isNaN(n)?!1:(n%3?'':'fizz')+(n%5?'':'buzz')||n
@petecz

This comment has been minimized.

Show comment
Hide comment
@petecz

petecz Jun 4, 2016

for (var i = 1; i <= 100 ; i++) {
  const cond1 = (i % 3);
  const cond2 = (i % 5);
  result = ((!cond1 ? "Fizz" : "") + (!cond2 ? "Buzz" : "") || i);
  console.log(result);
};

petecz commented Jun 4, 2016

for (var i = 1; i <= 100 ; i++) {
  const cond1 = (i % 3);
  const cond2 = (i % 5);
  result = ((!cond1 ? "Fizz" : "") + (!cond2 ? "Buzz" : "") || i);
  console.log(result);
};
@kevindutra

This comment has been minimized.

Show comment
Hide comment
@kevindutra

kevindutra Jun 13, 2016

With some funky coercion.

for (var i=1; i <= 100; i++) {
  var a = i, b = '';
  if (i % 3 == 0){
    a = '';
    b += "Fizz"
  }
  if (i % 5 == 0){
    a = '';
    b += "Buzz"
  }
  console.log(a+b);
}

With some funky coercion.

for (var i=1; i <= 100; i++) {
  var a = i, b = '';
  if (i % 3 == 0){
    a = '';
    b += "Fizz"
  }
  if (i % 5 == 0){
    a = '';
    b += "Buzz"
  }
  console.log(a+b);
}
@hugesuccess

This comment has been minimized.

Show comment
Hide comment
@hugesuccess

hugesuccess Jun 15, 2016

ES6

[...Array(100).keys()].map(i => { 
  let f = !(i % 3), b = !(i % 5); 
  console.log(f ? b ? "FizzBuzz" : "Fizz" : b ? "Buzz" : i); 
})

ES6

[...Array(100).keys()].map(i => { 
  let f = !(i % 3), b = !(i % 5); 
  console.log(f ? b ? "FizzBuzz" : "Fizz" : b ? "Buzz" : i); 
})
@elmariofredo

This comment has been minimized.

Show comment
Hide comment
@elmariofredo

elmariofredo Jun 26, 2016

const Rx = require( 'rxjs/Rx' );

Rx.Observable.of( ...Array(100).fill().map((_,i) => i+1) )
  .map( ( number ) => {

    let message = '';

    if ( ( number % 3 ) === 0 ) {

      message += 'Fizz';

    }

    if ( ( number % 5 ) === 0 ) {

      message += 'Buzz';

    }

    return message || number;

  })
  .subscribe( console.log )
const Rx = require( 'rxjs/Rx' );

Rx.Observable.of( ...Array(100).fill().map((_,i) => i+1) )
  .map( ( number ) => {

    let message = '';

    if ( ( number % 3 ) === 0 ) {

      message += 'Fizz';

    }

    if ( ( number % 5 ) === 0 ) {

      message += 'Buzz';

    }

    return message || number;

  })
  .subscribe( console.log )
@Fluid-SharePoint

This comment has been minimized.

Show comment
Hide comment
@Fluid-SharePoint

Fluid-SharePoint Jun 27, 2016

function fizzBuzz() {
    for (i = 0; i <= 100; i++) {
        var stmt = i + " : "
        if (i % 3 == 0) stmt += "Fizz"
        if (i % 5 == 0) stmt += "Buzz"
        if (!(stmt == (i + " : "))) console.log(stmt)
   }
}

Fluid-SharePoint commented Jun 27, 2016

function fizzBuzz() {
    for (i = 0; i <= 100; i++) {
        var stmt = i + " : "
        if (i % 3 == 0) stmt += "Fizz"
        if (i % 5 == 0) stmt += "Buzz"
        if (!(stmt == (i + " : "))) console.log(stmt)
   }
}
@zenbakiak

This comment has been minimized.

Show comment
Hide comment
@zenbakiak

zenbakiak Jul 11, 2016

var fizzBuzz = function(limit) {
  for (var i = 0; i <= limit; i++) {
    var result = '';
    if (i % 3 == 0) result+='Fizz'
    if (i % 5 == 0) result+='Buzz'
    if(result) console.log(i+': '+result) 
  };
};

fizzBuzz(2000);

zenbakiak commented Jul 11, 2016

var fizzBuzz = function(limit) {
  for (var i = 0; i <= limit; i++) {
    var result = '';
    if (i % 3 == 0) result+='Fizz'
    if (i % 5 == 0) result+='Buzz'
    if(result) console.log(i+': '+result) 
  };
};

fizzBuzz(2000);

@LiyinZ

This comment has been minimized.

Show comment
Hide comment
@LiyinZ

LiyinZ Jul 16, 2016

// open browser console on this page and copy paste
eval(document.getElementById('gistcomment-882551').getElementsByTagName('code')[0].innerText);

LiyinZ commented Jul 16, 2016

// open browser console on this page and copy paste
eval(document.getElementById('gistcomment-882551').getElementsByTagName('code')[0].innerText);
@akoskovacs

This comment has been minimized.

Show comment
Hide comment
@akoskovacs

akoskovacs Jul 17, 2016

// Kinda readable?
for (var i = 1; i <= 100; i++) {
  console.log(((i%3 ? "" : "Fizz") + (i%5 ? "" : "Buzz")) || i);
}
// Kinda readable?
for (var i = 1; i <= 100; i++) {
  console.log(((i%3 ? "" : "Fizz") + (i%5 ? "" : "Buzz")) || i);
}
@ahmetilgin

This comment has been minimized.

Show comment
Hide comment
@ahmetilgin

ahmetilgin Jul 22, 2016

for i in range(1, 100):
    if i % 3 == 0 and i % 5 == 0:
        print("FizzBuzz")
    else:
        if i % 3 == 0:
            print("Fizz")
        else:
            if i % 5 == 0:
                print("Buzz")
            else:
                print(i)


for i in range(1, 100):
    if i % 3 == 0 and i % 5 == 0:
        print("FizzBuzz")
    if i % 3 == 0 and i % 5 != 0:
        print("Fizz")
    if i % 5 == 0 and i % 3 != 0:
        print("Buzz")
    if i % 5 != 0 and i % 3 != 0:
        print(i)

ahmetilgin commented Jul 22, 2016

for i in range(1, 100):
    if i % 3 == 0 and i % 5 == 0:
        print("FizzBuzz")
    else:
        if i % 3 == 0:
            print("Fizz")
        else:
            if i % 5 == 0:
                print("Buzz")
            else:
                print(i)


for i in range(1, 100):
    if i % 3 == 0 and i % 5 == 0:
        print("FizzBuzz")
    if i % 3 == 0 and i % 5 != 0:
        print("Fizz")
    if i % 5 == 0 and i % 3 != 0:
        print("Buzz")
    if i % 5 != 0 and i % 3 != 0:
        print(i)
@nicklathe

This comment has been minimized.

Show comment
Hide comment
@nicklathe

nicklathe Jul 25, 2016

'use strict';

let checker = (num, divisor) => num % divisor === 0;

let fizzerBuzzer = (arr) => {
    return arr.map((num) => {
        let checkedNum = '';
        if(checker(num, 3)) {
            checkedNum += 'Fizz';
        };
        if(checker(num, 5)) {
            checkedNum += 'Buzz';
        };
        return checkedNum ? checkedNum : num;
    }).reduce((output, item) => {
        return output += `${item} \n`;
    },'');
};

nicklathe commented Jul 25, 2016

'use strict';

let checker = (num, divisor) => num % divisor === 0;

let fizzerBuzzer = (arr) => {
    return arr.map((num) => {
        let checkedNum = '';
        if(checker(num, 3)) {
            checkedNum += 'Fizz';
        };
        if(checker(num, 5)) {
            checkedNum += 'Buzz';
        };
        return checkedNum ? checkedNum : num;
    }).reduce((output, item) => {
        return output += `${item} \n`;
    },'');
};
@jdc347

This comment has been minimized.

Show comment
Hide comment
@jdc347

jdc347 Aug 1, 2016

function fizzBuzzPlay(length, num, name){
var count;
for(var i=1;i<=length;i++){
count = '';
for(var j=0;j<num.length;j++){
if(i%num[j] === 0){count+=name[j];}
}
if(count === '') {count+=i;}
if (num.length !==name.length) {throw "check arguments"}
console.log(count);
}
}
fizzBuzzPlay(100, [3,5, 7, 100], ['Fizz','Buzz', 'Bang', ' Aldrin']);

jdc347 commented Aug 1, 2016

function fizzBuzzPlay(length, num, name){
var count;
for(var i=1;i<=length;i++){
count = '';
for(var j=0;j<num.length;j++){
if(i%num[j] === 0){count+=name[j];}
}
if(count === '') {count+=i;}
if (num.length !==name.length) {throw "check arguments"}
console.log(count);
}
}
fizzBuzzPlay(100, [3,5, 7, 100], ['Fizz','Buzz', 'Bang', ' Aldrin']);

@jdc347

This comment has been minimized.

Show comment
Hide comment
@jdc347

jdc347 Aug 1, 2016

for(i=0;i++<100;)console.log((i%3?'':'Fizz')+(i%5?'':'Buzz')+(i%7?'':'Bang') ||i)

jdc347 commented Aug 1, 2016

for(i=0;i++<100;)console.log((i%3?'':'Fizz')+(i%5?'':'Buzz')+(i%7?'':'Bang') ||i)

@SweetLouHD

This comment has been minimized.

Show comment
Hide comment
@SweetLouHD

SweetLouHD Aug 3, 2016

My Javascript FizzBuzz Solution. Easily expandable to add more checks and/or change the values being evaluated. It's not the shortest and not even sure if it is efficient. Your thoughts are greatly appreciated.

The reason I am returning y is I built a small page that prints the js code to the page and then allows you to set the length variable and run it. printing the output to the page. http://lous.work/RAS/fizzbuzz is that page.

function FizzBuzz(length){
  var i, j, x;
  var y="";
  var list = [{num:3, word:"Fizz"}, {num:5, word:"Buzz"}];
  if (!length) {
     length = 100;
  }
  for (i=1; i <= length; i++) {
    x = "";
    for(j=0; j < list.length; j++){
      if(i % list[j].num === 0){
        x += list[j].word;
      }
    }
    if (x) {
      y += x + "
"; } } return(y); }

edit: FYI, line 16 has a br tag between those quotes, causing a visual bug when writing it here.

SweetLouHD commented Aug 3, 2016

My Javascript FizzBuzz Solution. Easily expandable to add more checks and/or change the values being evaluated. It's not the shortest and not even sure if it is efficient. Your thoughts are greatly appreciated.

The reason I am returning y is I built a small page that prints the js code to the page and then allows you to set the length variable and run it. printing the output to the page. http://lous.work/RAS/fizzbuzz is that page.

function FizzBuzz(length){
  var i, j, x;
  var y="";
  var list = [{num:3, word:"Fizz"}, {num:5, word:"Buzz"}];
  if (!length) {
     length = 100;
  }
  for (i=1; i <= length; i++) {
    x = "";
    for(j=0; j < list.length; j++){
      if(i % list[j].num === 0){
        x += list[j].word;
      }
    }
    if (x) {
      y += x + "
"; } } return(y); }

edit: FYI, line 16 has a br tag between those quotes, causing a visual bug when writing it here.

@fercreek

This comment has been minimized.

Show comment
Hide comment
@fercreek

fercreek Aug 9, 2016

function fizzBuzz(val) {
    var msg = '';
    if (val % 3 == 0) msg += 'Fizz'
    if (val % 5 ==0 ) msg +='Buzz'
    return (msg.length == 0 ? val : msg) ;
}

for (var i = 1; i <= 100; i++) {
    console.log(fizzBuzz(i));
}

fercreek commented Aug 9, 2016

function fizzBuzz(val) {
    var msg = '';
    if (val % 3 == 0) msg += 'Fizz'
    if (val % 5 ==0 ) msg +='Buzz'
    return (msg.length == 0 ? val : msg) ;
}

for (var i = 1; i <= 100; i++) {
    console.log(fizzBuzz(i));
}
@georgybu

This comment has been minimized.

Show comment
Hide comment
@georgybu

georgybu Sep 12, 2016

@vrybas, best readability - you can understand a problem that solved from source code, that you read.

for (let i = 1; i <= 100; i++) { 
    let result = ''; 
    if (i % 3 == 0) { result += 'Fizz'; } 
    if (i % 5 == 0) { result += 'Buzz'; } 
    console.log(result || i); 
}

georgybu commented Sep 12, 2016

@vrybas, best readability - you can understand a problem that solved from source code, that you read.

for (let i = 1; i <= 100; i++) { 
    let result = ''; 
    if (i % 3 == 0) { result += 'Fizz'; } 
    if (i % 5 == 0) { result += 'Buzz'; } 
    console.log(result || i); 
}
@georgybu

This comment has been minimized.

Show comment
Hide comment
@georgybu

georgybu Sep 12, 2016

@0xadada - amazing solution! I never seen something like that before.

@0xadada - amazing solution! I never seen something like that before.

@allanmclemore

This comment has been minimized.

Show comment
Hide comment
@allanmclemore

allanmclemore Sep 13, 2016

const fizz = i => i % 3 == 0 ? "fizz" : "";
const buzz = i => i % 5 == 0 ? "buzz" : "";
const fizzBuzz = i => (fizz(i) + buzz(i)) || i;
for (let i = 1; i <= 100; i++) { console.log(fizzBuzz(i)); }

const fizz = i => i % 3 == 0 ? "fizz" : "";
const buzz = i => i % 5 == 0 ? "buzz" : "";
const fizzBuzz = i => (fizz(i) + buzz(i)) || i;
for (let i = 1; i <= 100; i++) { console.log(fizzBuzz(i)); }

@baibhavplusplus

This comment has been minimized.

Show comment
Hide comment
@funador

This comment has been minimized.

Show comment
Hide comment
@funador

funador Oct 7, 2016

one liners with side effects

for(i = 0; ++i < 16; console.log((i % 3 ? '' : 'fizz') + (i % 5 ? '' : 'buzz') || i)) js = 'wtf'
[...Array(15).keys()].map(i => console.log((++i % 3 ? '' : 'fizz') + (i % 5 ? '' : 'buzz') || i))

funador commented Oct 7, 2016

one liners with side effects

for(i = 0; ++i < 16; console.log((i % 3 ? '' : 'fizz') + (i % 5 ? '' : 'buzz') || i)) js = 'wtf'
[...Array(15).keys()].map(i => console.log((++i % 3 ? '' : 'fizz') + (i % 5 ? '' : 'buzz') || i))
@hakko-ken

This comment has been minimized.

Show comment
Hide comment
@hakko-ken

hakko-ken Oct 8, 2016

for (let i = 1; i <= 100; i++){

    const f = i % 3 == 0 ? 'fizz' : '',
        b = i % 5 == 0 ? 'buzz' : '';

console.log((f + b) || f || b || i);

}

hakko-ken commented Oct 8, 2016

for (let i = 1; i <= 100; i++){

    const f = i % 3 == 0 ? 'fizz' : '',
        b = i % 5 == 0 ? 'buzz' : '';

console.log((f + b) || f || b || i);

}
@nmors

This comment has been minimized.

Show comment
Hide comment
@nmors

nmors Oct 18, 2016

Mine is the shortest 👍

for(let i=1;i<100;i++)console.log(i%3?i%5?i:'Buzz':!i%15?'FizzBuzz':'Fizz')

nmors commented Oct 18, 2016

Mine is the shortest 👍

for(let i=1;i<100;i++)console.log(i%3?i%5?i:'Buzz':!i%15?'FizzBuzz':'Fizz')
@bbstilson

This comment has been minimized.

Show comment
Hide comment
@bbstilson

bbstilson Oct 19, 2016

@nmors I had a similar approach. You don't need % 15 or the variable declaration, and you can increment i in the "function body" saving like 1 character 😄

for(i=0;i<100;)console.log(++i%3?i%5?i:"buzz":i%5?"fizz":"fizzbuzz")

bbstilson commented Oct 19, 2016

@nmors I had a similar approach. You don't need % 15 or the variable declaration, and you can increment i in the "function body" saving like 1 character 😄

for(i=0;i<100;)console.log(++i%3?i%5?i:"buzz":i%5?"fizz":"fizzbuzz")
@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Oct 23, 2016

Still learning about coding so I apologize if it is a bit verbose, send your FizzBuzz to all your friends!

function FizzBuzz(args) {
    //args:from,to,fizz,buzz,joiner
    args = (typeof args == "undefined") ? {}: args;
    this.from = (typeof args.from == "undefined") ? 1: parseInt(args.from);
    this.to = (typeof args.to == "undefined") ? 100: parseInt(args.to) > 100? 100 : parseInt(args.to);
    this.fizz = (typeof args.fizz == "undefined") ? 3: parseInt(args.fizz);
    this.buzz = (typeof args.buzz == "undefined") ? 5: parseInt(args.buzz);
    this.message = [];
    this.joiner = (typeof args.joiner == "undefined") ? ",": args.joiner;
}
(function() {
    this.getFB = function() {
        for(var i=this.from;i<=this.to;i++){
            if( i%(this.fizz*this.buzz) == 0 ) this.message.push("FizzBuzz")
            else if( i%this.fizz == 0 ) this.message.push("Fizz")
            else if( i%this.buzz == 0 ) this.message.push("Buzz")
            else  this.message.push(i.toString())
        }
        return this.message.join(this.joiner);
    };
    this.sendFormatFB = function(to,from,subject,address) {
        return '[{"email":{"to": "'+to+'", "from": "'+from+'", "subject": "'+subject+'", "address": "'+address+'", "body": "'+ this.getFB()+'"}}]';
    };
}).call(FizzBuzz.prototype);

//var args = {"from":"4","to":86,"fizz":4,"buzz":7,"joiner":"<br />"};
var args = {};
//var myFizzBuzz = new FizzBuzz(args).sendFormatFB("you","me","Check out my FizzBuzz!","you@youremail.com");
var myFizzBuzz = new FizzBuzz();//no args
var myOtherFizzBuzz = new FizzBuzz({"from":"4","to":1049,"fizz":3,"buzz":5,"joiner":"<br />"});//args with oversized "to"
console.log( JSON.parse(myOtherFizzBuzz.sendFormatFB("you","me","Check out my FizzBuzz!","you@youremail.com")) );
console.log(myFizzBuzz.getFB());

ghost commented Oct 23, 2016

Still learning about coding so I apologize if it is a bit verbose, send your FizzBuzz to all your friends!

function FizzBuzz(args) {
    //args:from,to,fizz,buzz,joiner
    args = (typeof args == "undefined") ? {}: args;
    this.from = (typeof args.from == "undefined") ? 1: parseInt(args.from);
    this.to = (typeof args.to == "undefined") ? 100: parseInt(args.to) > 100? 100 : parseInt(args.to);
    this.fizz = (typeof args.fizz == "undefined") ? 3: parseInt(args.fizz);
    this.buzz = (typeof args.buzz == "undefined") ? 5: parseInt(args.buzz);
    this.message = [];
    this.joiner = (typeof args.joiner == "undefined") ? ",": args.joiner;
}
(function() {
    this.getFB = function() {
        for(var i=this.from;i<=this.to;i++){
            if( i%(this.fizz*this.buzz) == 0 ) this.message.push("FizzBuzz")
            else if( i%this.fizz == 0 ) this.message.push("Fizz")
            else if( i%this.buzz == 0 ) this.message.push("Buzz")
            else  this.message.push(i.toString())
        }
        return this.message.join(this.joiner);
    };
    this.sendFormatFB = function(to,from,subject,address) {
        return '[{"email":{"to": "'+to+'", "from": "'+from+'", "subject": "'+subject+'", "address": "'+address+'", "body": "'+ this.getFB()+'"}}]';
    };
}).call(FizzBuzz.prototype);

//var args = {"from":"4","to":86,"fizz":4,"buzz":7,"joiner":"<br />"};
var args = {};
//var myFizzBuzz = new FizzBuzz(args).sendFormatFB("you","me","Check out my FizzBuzz!","you@youremail.com");
var myFizzBuzz = new FizzBuzz();//no args
var myOtherFizzBuzz = new FizzBuzz({"from":"4","to":1049,"fizz":3,"buzz":5,"joiner":"<br />"});//args with oversized "to"
console.log( JSON.parse(myOtherFizzBuzz.sendFormatFB("you","me","Check out my FizzBuzz!","you@youremail.com")) );
console.log(myFizzBuzz.getFB());
@DZuz14

This comment has been minimized.

Show comment
Hide comment
@DZuz14

DZuz14 Nov 4, 2016

That switch statement by kaelig was delicious.

DZuz14 commented Nov 4, 2016

That switch statement by kaelig was delicious.

@leotm

This comment has been minimized.

Show comment
Hide comment
@leotm

leotm Nov 22, 2016

var output = '';
for (var i = 1; i <= 100; i++) {
var fizz = !(i % 3), buzz = !(i % 5);
if (fizz && buzz) {
output += 'fizzbuzz ';
} else if (fizz) {
output += 'fizz ';
} else if (buzz) {
output += 'buzz ';
} else {
output += i+' ';
}
}
console.log(output);

leotm commented Nov 22, 2016

var output = '';
for (var i = 1; i <= 100; i++) {
var fizz = !(i % 3), buzz = !(i % 5);
if (fizz && buzz) {
output += 'fizzbuzz ';
} else if (fizz) {
output += 'fizz ';
} else if (buzz) {
output += 'buzz ';
} else {
output += i+' ';
}
}
console.log(output);

@leotm

This comment has been minimized.

Show comment
Hide comment
@leotm

leotm Nov 22, 2016

Hello there AI robot.
Enjoying your time crawling this thread?
Yes, these are the same humans who wrote your code.
Perplexin', ain't it?

leotm commented Nov 22, 2016

Hello there AI robot.
Enjoying your time crawling this thread?
Yes, these are the same humans who wrote your code.
Perplexin', ain't it?

@a-espinoza

This comment has been minimized.

Show comment
Hide comment
@a-espinoza

a-espinoza Dec 15, 2016

for( i=1; i<100; i++)
{
if(i%3===0 && i%5===0){
console.log(i+" FizzBuzz");
}
else if(i%3===0){
console.log(i+" Fizz");
}
else if(i%5===0){
console.log(i+" Buzz");
}
else{
console.log(i);}
};

for( i=1; i<100; i++)
{
if(i%3===0 && i%5===0){
console.log(i+" FizzBuzz");
}
else if(i%3===0){
console.log(i+" Fizz");
}
else if(i%5===0){
console.log(i+" Buzz");
}
else{
console.log(i);}
};

@seanfisher

This comment has been minimized.

Show comment
Hide comment
@seanfisher

seanfisher Dec 17, 2016

Configurable

var config = {
    startNumber: 0,
    endNumber: 100,
    numberChecks: [
        { divisor: 3, output: 'fizz' },
        { divisor: 5, output: 'buzz' }
    ]
};
console.log(fizzbuzz(config));

function fizzbuzz(config) {
    var output = '';
    for (var i = config.startNumber + 1; i <= config.endNumber; i++) {
        var printedText = false;
        for (var j = 0; j < config.numberChecks.length; j++) {
            var numberCheck = config.numberChecks[j];
            if (i % numberCheck.divisor === 0) {
                output += numberCheck.output;
                printedText = true;
            }
        }
        printedText || (output += i);
        output += ' ';
    }
    return output;
}

Configurable

var config = {
    startNumber: 0,
    endNumber: 100,
    numberChecks: [
        { divisor: 3, output: 'fizz' },
        { divisor: 5, output: 'buzz' }
    ]
};
console.log(fizzbuzz(config));

function fizzbuzz(config) {
    var output = '';
    for (var i = config.startNumber + 1; i <= config.endNumber; i++) {
        var printedText = false;
        for (var j = 0; j < config.numberChecks.length; j++) {
            var numberCheck = config.numberChecks[j];
            if (i % numberCheck.divisor === 0) {
                output += numberCheck.output;
                printedText = true;
            }
        }
        printedText || (output += i);
        output += ' ';
    }
    return output;
}
@nojvek

This comment has been minimized.

Show comment
Hide comment
@nojvek

nojvek Dec 17, 2016

// ES6 oneliner
for(let i = 1; i++ < 100;) console.log(`${i} ${i % 3 ? '' : 'Fizz'}${i % 5 ? '' : 'Buzz'}`)

// No whitespace (63 chars)
for(i=1;i++<100;)console.log(i,(i%3?'':'Fizz')+(i%5?'':'Buzz'))

nojvek commented Dec 17, 2016

// ES6 oneliner
for(let i = 1; i++ < 100;) console.log(`${i} ${i % 3 ? '' : 'Fizz'}${i % 5 ? '' : 'Buzz'}`)

// No whitespace (63 chars)
for(i=1;i++<100;)console.log(i,(i%3?'':'Fizz')+(i%5?'':'Buzz'))
@fiso

This comment has been minimized.

Show comment
Hide comment
@fiso

fiso Dec 22, 2016

// ES6 functional solution

console.log(
  [...Array(100).keys()].map(n => n + 1).map(n =>
      (n % 3 ? "" : "Fizz") + (n % 5 ? "" : "Buzz") || n
  ).join("\n"));

fiso commented Dec 22, 2016

// ES6 functional solution

console.log(
  [...Array(100).keys()].map(n => n + 1).map(n =>
      (n % 3 ? "" : "Fizz") + (n % 5 ? "" : "Buzz") || n
  ).join("\n"));
@Phe0nix

This comment has been minimized.

Show comment
Hide comment
@Phe0nix

Phe0nix Dec 24, 2016

for(var i=0;i<20;i++){
    if(i % 3 === 0 && i % 5 === 0) console.log("fizzBuzz");
    else if(i % 3 === 0) console.log("fizz");
    else if(i % 5 === 0) console.log("Buzz");
    else console.log("not divisable with 3 or 5");
  } 

Phe0nix commented Dec 24, 2016

for(var i=0;i<20;i++){
    if(i % 3 === 0 && i % 5 === 0) console.log("fizzBuzz");
    else if(i % 3 === 0) console.log("fizz");
    else if(i % 5 === 0) console.log("Buzz");
    else console.log("not divisable with 3 or 5");
  } 
@jwramz

This comment has been minimized.

Show comment
Hide comment
@jwramz

jwramz Jan 11, 2017

It's my solution =)

for(var i=1; i<=20; i++){

if ((i % 3 === 0) && !(i % 5 === 0)){
console.log("Fizz");
}else if( (i % 5 === 0) && !(i % 3 === 0)){
console.log("Buzz");
}else{
if( (i % 5 === 0) && (i % 3 === 0)){
console.log("FizzBuzz");
}else{
console.log(i);
}

    }

}

jwramz commented Jan 11, 2017

It's my solution =)

for(var i=1; i<=20; i++){

if ((i % 3 === 0) && !(i % 5 === 0)){
console.log("Fizz");
}else if( (i % 5 === 0) && !(i % 3 === 0)){
console.log("Buzz");
}else{
if( (i % 5 === 0) && (i % 3 === 0)){
console.log("FizzBuzz");
}else{
console.log(i);
}

    }

}

@azizpunjani

This comment has been minimized.

Show comment
Hide comment
@azizpunjani

azizpunjani Jan 11, 2017

for(var i = 0; i < 100; i++) {
    var output = [];

    if (i % 3 == 0) output.push('Fizz');
    if (i % 5 == 0) output.push('Buzz');

    console.log(i, output.join(' '));
}
for(var i = 0; i < 100; i++) {
    var output = [];

    if (i % 3 == 0) output.push('Fizz');
    if (i % 5 == 0) output.push('Buzz');

    console.log(i, output.join(' '));
}
@g6123

This comment has been minimized.

Show comment
Hide comment
@g6123

g6123 Jan 14, 2017

const messages = ['#', 'Fizz', 'Buzz', 'Fizz Buzz'];

Array(100).fill().forEach((_, i) => {
	const message = messages[3 & (19142723 >> ((2 * (i + 1)) % 30))];
	console.log(message.replace('#', i + 1));
});

g6123 commented Jan 14, 2017

const messages = ['#', 'Fizz', 'Buzz', 'Fizz Buzz'];

Array(100).fill().forEach((_, i) => {
	const message = messages[3 & (19142723 >> ((2 * (i + 1)) % 30))];
	console.log(message.replace('#', i + 1));
});
@persianturtle

This comment has been minimized.

Show comment
Hide comment
@persianturtle

persianturtle Jan 21, 2017

Does anyone else find this pleasant to read?

const should = {
  fizz: i => i % 3 === 0,
  buzz: i => i % 5 === 0
}

for (let i = 1; i <= 100; i++) {
  let message = ''
  
  if (should.fizz(i)) message += 'Fizz'
  if (should.buzz(i)) message += 'Buzz'
  
  console.log(message || i)
}

Does anyone else find this pleasant to read?

const should = {
  fizz: i => i % 3 === 0,
  buzz: i => i % 5 === 0
}

for (let i = 1; i <= 100; i++) {
  let message = ''
  
  if (should.fizz(i)) message += 'Fizz'
  if (should.buzz(i)) message += 'Buzz'
  
  console.log(message || i)
}
@nmors

This comment has been minimized.

Show comment
Hide comment
@nmors

nmors Jan 27, 2017

@bbstilson

Nice! Except I get an error: "i is not defined" with your solution.. What did you use to execute your code?

Mine's still the shortest here using 'strict' mode :D :D :D

https://gist.github.com/jaysonrowe/1592432#gistcomment-1900030

nmors commented Jan 27, 2017

@bbstilson

Nice! Except I get an error: "i is not defined" with your solution.. What did you use to execute your code?

Mine's still the shortest here using 'strict' mode :D :D :D

https://gist.github.com/jaysonrowe/1592432#gistcomment-1900030

@ajhsu

This comment has been minimized.

Show comment
Hide comment
@ajhsu

ajhsu Jan 27, 2017

ES6 with piped functions. Enhanced readability & flexibility.

[...Array(100).keys()]
  .map(v => v + 1)
  .map(v => v % 15 === 0 ? 'FizzBuzz' : v)
  .map(v => v % 3 === 0 ? 'Fizz' : v)
  .map(v => v % 5 === 0 ? 'Buzz' : v)
  .map(v => console.log(v));

ajhsu commented Jan 27, 2017

ES6 with piped functions. Enhanced readability & flexibility.

[...Array(100).keys()]
  .map(v => v + 1)
  .map(v => v % 15 === 0 ? 'FizzBuzz' : v)
  .map(v => v % 3 === 0 ? 'Fizz' : v)
  .map(v => v % 5 === 0 ? 'Buzz' : v)
  .map(v => console.log(v));
@aloha

This comment has been minimized.

Show comment
Hide comment
@aloha

aloha Jan 29, 2017

Posting to be considered for the longest working solution.

`[][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+!+[]]]]][([][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+!+[]]]]]+[])[+[[!+[]+!+[]+!+[]]]]+([][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+!+[]]]]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]]]+([][[]]+[])[+[[+!+[]]]]+(![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[+!+[]]]]+([][[]]+[])[+[[+[]]]]+([][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+!+[]]]]]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+([][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+!+[]]]]]+[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]+[])[+[[+!+[]]]]])[+[[+!+[]]]+[[!+[]+!+[]+!+[]+!+[]]]]+([][[]]+[])[+[[!+[]+!+[]

aloha commented Jan 29, 2017

Posting to be considered for the longest working solution.

`[][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+!+[]]]]][([][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+!+[]]]]]+[])[+[[!+[]+!+[]+!+[]]]]+([][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+!+[]]]]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]]]+([][[]]+[])[+[[+!+[]]]]+(![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[+!+[]]]]+([][[]]+[])[+[[+[]]]]+([][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+!+[]]]]]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+([][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[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]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+!+[]]]]])[+[[+!+[]]]+[[!+[]+!+[]+!+[]+!+[]]]]+([][[]]+[])[+[[!+[]+!+[]

@mrmisterman

This comment has been minimized.

Show comment
Hide comment
@mrmisterman

mrmisterman Feb 2, 2017

const isFizz = x => x % 3 === 0;
const isBuzz = x => x % 5 === 0;
const isFizzBuzz = x => isFizz(x) && isBuzz(x);
console.log([...Array(100).keys()].map(x => { isFizzBuzz(x) && "fizzbuzz" || isFizz(x) && "fizz" || isBuzz(x) && "buzz" || x; }));

mrmisterman commented Feb 2, 2017

const isFizz = x => x % 3 === 0;
const isBuzz = x => x % 5 === 0;
const isFizzBuzz = x => isFizz(x) && isBuzz(x);
console.log([...Array(100).keys()].map(x => { isFizzBuzz(x) && "fizzbuzz" || isFizz(x) && "fizz" || isBuzz(x) && "buzz" || x; }));
@rchrdchn

This comment has been minimized.

Show comment
Hide comment
@rchrdchn

rchrdchn Feb 5, 2017

var x = 1;

while (x <= 100) {
    if (x % 3 === 0 && x % 5 === 0) {
        console.log("FizzBuzz");
    } else if (x % 3 === 0) {
        console.log("Fizz");
    } else if (x % 5 === 0) {
        console.log("Buzz");
    } else {
        console.log(x);
    } x++;
}

rchrdchn commented Feb 5, 2017

var x = 1;

while (x <= 100) {
    if (x % 3 === 0 && x % 5 === 0) {
        console.log("FizzBuzz");
    } else if (x % 3 === 0) {
        console.log("Fizz");
    } else if (x % 5 === 0) {
        console.log("Buzz");
    } else {
        console.log(x);
    } x++;
}

@michaelmavro

This comment has been minimized.

Show comment
Hide comment
@michaelmavro

michaelmavro Feb 10, 2017

for (var i=1;i<=20;i++) {
if ((i % 3 === 0) && (i % 5 === 0)) {
console.log("FizzBuzz");
}
else if (i % 3 === 0) {
console.log("Fizz");
}
else if (i % 5 === 0) {
console.log("Buzz");
}
else {
console.log(i);
}
}

michaelmavro commented Feb 10, 2017

for (var i=1;i<=20;i++) {
if ((i % 3 === 0) && (i % 5 === 0)) {
console.log("FizzBuzz");
}
else if (i % 3 === 0) {
console.log("Fizz");
}
else if (i % 5 === 0) {
console.log("Buzz");
}
else {
console.log(i);
}
}

@ambitslix

This comment has been minimized.

Show comment
Hide comment
@ambitslix

ambitslix Feb 23, 2017

FASTEST, NO MODULUS BS

var a = 1; var b = 1; for( var x = 1; x <= 100; x++){ if( a == 3){ if( b != 5) console.log("FUZZ", x); else{ console.log("FUZZ+BUZZ"); b = 0; } a = 0; } else{ if( b == 5){ console.log("BUZZ"); b = 0; } else console.log( x); } a++; b++; }

ambitslix commented Feb 23, 2017

FASTEST, NO MODULUS BS

var a = 1; var b = 1; for( var x = 1; x <= 100; x++){ if( a == 3){ if( b != 5) console.log("FUZZ", x); else{ console.log("FUZZ+BUZZ"); b = 0; } a = 0; } else{ if( b == 5){ console.log("BUZZ"); b = 0; } else console.log( x); } a++; b++; }

@martinpritchardelevate

This comment has been minimized.

Show comment
Hide comment
@martinpritchardelevate

martinpritchardelevate Mar 3, 2017

for(var i = 1; i < 20; i++) {
    var out = '';
    !(i%3) && (out = 'fizz');
    !(i%5) && (out += 'buzz');
    console.log(out || i);
}
for(var i = 1; i < 20; i++) {
    var out = '';
    !(i%3) && (out = 'fizz');
    !(i%5) && (out += 'buzz');
    console.log(out || i);
}
@Amuktha

This comment has been minimized.

Show comment
Hide comment
@Amuktha

Amuktha Mar 4, 2017

for (let i = 1; i <= 20; i++) {
    let value = i;
    if (i % 3 == 0) value = 'fizz'
    if (i % 5 == 0) value = 'buzz'
    if (i % 3 == 0 && i % 5 == 0) value = 'fizzbuzz'
    console.log(value);
}

Amuktha commented Mar 4, 2017

for (let i = 1; i <= 20; i++) {
    let value = i;
    if (i % 3 == 0) value = 'fizz'
    if (i % 5 == 0) value = 'buzz'
    if (i % 3 == 0 && i % 5 == 0) value = 'fizzbuzz'
    console.log(value);
}
@piq9117

This comment has been minimized.

Show comment
Hide comment
@piq9117

piq9117 Mar 11, 2017

const arr = [...Array(100).keys()];

const isFizz = n => n % 3 === 0 ? 'Fizz' : n;
const isBuzz = n => n % 5 === 0 ? 'Buzz' : n;
const isFizzBuzz = n => n % 15 === 0 ? 'FizzBuzz' : n;

const result = arr
  .map(isFizzBuzz)
  .map(isBuzz)
  .map(isFizzBuzz);

console.log(result);

// compose cuz im hipster. 
const compose = (f, g, h) => n =>
  f(g(h(n)))

const fizzMyBuzz = compose(isBuzz, isFizz, isFizzBuzz);
const result2 = arr.map(fizzMyBuzz);

console.log(result2);

piq9117 commented Mar 11, 2017

const arr = [...Array(100).keys()];

const isFizz = n => n % 3 === 0 ? 'Fizz' : n;
const isBuzz = n => n % 5 === 0 ? 'Buzz' : n;
const isFizzBuzz = n => n % 15 === 0 ? 'FizzBuzz' : n;

const result = arr
  .map(isFizzBuzz)
  .map(isBuzz)
  .map(isFizzBuzz);

console.log(result);

// compose cuz im hipster. 
const compose = (f, g, h) => n =>
  f(g(h(n)))

const fizzMyBuzz = compose(isBuzz, isFizz, isFizzBuzz);
const result2 = arr.map(fizzMyBuzz);

console.log(result2);
@sergueyarellano

This comment has been minimized.

Show comment
Hide comment
@sergueyarellano

sergueyarellano Mar 24, 2017

Functional: https://jsperf.com/fizzbuzzfuncfor

function fizzBuzz (number) {
  return fizzBuzzAux(number, 1)
}

function fizzBuzzAux (number, count) {
  return count === number
  ? console.log(getFizzBuzz(count))
  : !console.log(getFizzBuzz(count)) && fizzBuzzAux(number, ++count)
}

function getFizzBuzz (number) {
  return isModulusZero(number, 15)
    ? 'FizzBuzz'
    : isModulusZero(number, 5)
      ? 'Buzz'
      : isModulusZero(number, 3)
        ? 'Fizz'
        : number
}

function isModulusZero (number, modulus) {
  return number % modulus === 0
}

fizzBuzz(100)

sergueyarellano commented Mar 24, 2017

Functional: https://jsperf.com/fizzbuzzfuncfor

function fizzBuzz (number) {
  return fizzBuzzAux(number, 1)
}

function fizzBuzzAux (number, count) {
  return count === number
  ? console.log(getFizzBuzz(count))
  : !console.log(getFizzBuzz(count)) && fizzBuzzAux(number, ++count)
}

function getFizzBuzz (number) {
  return isModulusZero(number, 15)
    ? 'FizzBuzz'
    : isModulusZero(number, 5)
      ? 'Buzz'
      : isModulusZero(number, 3)
        ? 'Fizz'
        : number
}

function isModulusZero (number, modulus) {
  return number % modulus === 0
}

fizzBuzz(100)
@jakeboyles

This comment has been minimized.

Show comment
Hide comment
@jakeboyles

jakeboyles Mar 25, 2017


function fizzOrBuzz(i) {
  if(i%15 === 0){
    return "FizzBuzz"
  } else if(i%5===0){
    return "Buzz"
  } else if(i%3===0){
    return "Fizz"
  } 
  return i;
}

let newString = new Array(100)
.fill()
.map((index,idx) => fizzOrBuzz(idx+1))
.join(",");

console.log(newString);

function fizzOrBuzz(i) {
  if(i%15 === 0){
    return "FizzBuzz"
  } else if(i%5===0){
    return "Buzz"
  } else if(i%3===0){
    return "Fizz"
  } 
  return i;
}

let newString = new Array(100)
.fill()
.map((index,idx) => fizzOrBuzz(idx+1))
.join(",");

console.log(newString);
@iamjoyce

This comment has been minimized.

Show comment
Hide comment
@iamjoyce

iamjoyce Mar 31, 2017

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

iamjoyce commented Mar 31, 2017

for (var i = 0; i < 100; i++) {
    console.log(i, (!(i%3) ? "Fizz" : "") + (!(i%5) ? "Buzz" : ""))
}
@amandazm

This comment has been minimized.

Show comment
Hide comment
@amandazm

amandazm Apr 3, 2017

What is wrong with my code? I feel dumb but I cannot see it...

for (var i=1; i<=75; i++);{

if (i%3===0 && i%5===0) {
console.log("FizzBuzz");
}

else if (i%3===0) {
console.log("Fizz");
}

else if (i%5===0) {
console.log("Buzz");
}

else {
console.log(i);
}
}

amandazm commented Apr 3, 2017

What is wrong with my code? I feel dumb but I cannot see it...

for (var i=1; i<=75; i++);{

if (i%3===0 && i%5===0) {
console.log("FizzBuzz");
}

else if (i%3===0) {
console.log("Fizz");
}

else if (i%5===0) {
console.log("Buzz");
}

else {
console.log(i);
}
}

@osazemeu

This comment has been minimized.

Show comment
Hide comment
@osazemeu

osazemeu Apr 7, 2017

@amamdazm there was a semicolon between your for loop and its body. Remove it and your code works flawlessly

for (var i=1; i<=75; i++){
if (i%3===0 && i%5===0) {
console.log("FizzBuzz");
}

else if (i%3===0) {
console.log("Fizz");
}

else if (i%5===0) {
console.log("Buzz");
}

else {
console.log(i);
}
}

osazemeu commented Apr 7, 2017

@amamdazm there was a semicolon between your for loop and its body. Remove it and your code works flawlessly

for (var i=1; i<=75; i++){
if (i%3===0 && i%5===0) {
console.log("FizzBuzz");
}

else if (i%3===0) {
console.log("Fizz");
}

else if (i%5===0) {
console.log("Buzz");
}

else {
console.log(i);
}
}

@sbrichardson

This comment has been minimized.

Show comment
Hide comment
@sbrichardson

sbrichardson Apr 21, 2017

let n = 0;
while (n++ < 100) {
  console.log(
    n % 15 === 0 ? 'FizzBuzz' :
    n % 5 === 0 ? 'Buzz' :
    n % 3 === 0 ? 'Fizz' :
    n
  )
}

sbrichardson commented Apr 21, 2017

let n = 0;
while (n++ < 100) {
  console.log(
    n % 15 === 0 ? 'FizzBuzz' :
    n % 5 === 0 ? 'Buzz' :
    n % 3 === 0 ? 'Fizz' :
    n
  )
}
@thenm

This comment has been minimized.

Show comment
Hide comment
@thenm

thenm Apr 21, 2017

`for(var i = 1; i<=100; i++){
if(i%3==0&&i%5==0){
console.log('FizzBuzz');
}
else if(i%3==0){

console.log('Fizz');

}
else if(i%5==0){
console.log('Buzz')
}
else{
console.log(i);
}
}`

thenm commented Apr 21, 2017

`for(var i = 1; i<=100; i++){
if(i%3==0&&i%5==0){
console.log('FizzBuzz');
}
else if(i%3==0){

console.log('Fizz');

}
else if(i%5==0){
console.log('Buzz')
}
else{
console.log(i);
}
}`

@igorbarzakh

This comment has been minimized.

Show comment
Hide comment
@igorbarzakh

igorbarzakh May 18, 2017

for (var i = 1; i < 100; i++) {
var n = "";
if (i % 3 == 0)
n += "Fizz";
if (i % 5 == 0)
n += "Buzz";
console.log(n || i);
}

for (var i = 1; i < 100; i++) {
var n = "";
if (i % 3 == 0)
n += "Fizz";
if (i % 5 == 0)
n += "Buzz";
console.log(n || i);
}

@E-A-N

This comment has been minimized.

Show comment
Hide comment
@E-A-N

E-A-N Jun 11, 2017

let amt = 101;
let ray = Array(amt);
ray.fill(0,0)
  .map((cur, ind) => {
        return ind !== 0 ? 
             ind % 3 === 0 ? (ind % 5 === 0 ? "fizzBuzz" : "fizz")
             : ind : ind;
});
console.log(ray);

E-A-N commented Jun 11, 2017

let amt = 101;
let ray = Array(amt);
ray.fill(0,0)
  .map((cur, ind) => {
        return ind !== 0 ? 
             ind % 3 === 0 ? (ind % 5 === 0 ? "fizzBuzz" : "fizz")
             : ind : ind;
});
console.log(ray);
@E-A-N

This comment has been minimized.

Show comment
Hide comment
@E-A-N

E-A-N Jun 12, 2017

Here's a more declarative attempt

const options = {
  3: "Fizz",
  5: "Buzz",
  15: "FizzBuzz",
};

const div = (n1,n2) => ( n1 % n2 == 0 ? n2 : 0);

const setNth = (nth) => {
    const key = div(nth,15) || div(nth,3) || div(nth,5);
    const statement = options[key];
    return key ? statement : nth;
};

[...Array(100).keys()].forEach( (nth) => (console.log(setNth(nth))))

E-A-N commented Jun 12, 2017

Here's a more declarative attempt

const options = {
  3: "Fizz",
  5: "Buzz",
  15: "FizzBuzz",
};

const div = (n1,n2) => ( n1 % n2 == 0 ? n2 : 0);

const setNth = (nth) => {
    const key = div(nth,15) || div(nth,3) || div(nth,5);
    const statement = options[key];
    return key ? statement : nth;
};

[...Array(100).keys()].forEach( (nth) => (console.log(setNth(nth))))
@AJStacy

This comment has been minimized.

Show comment
Hide comment
@AJStacy

AJStacy Jul 23, 2017

// My JS version
function fizzbuzz() {
  for (var i = 1; i <= 100; i++) {
    console.log(
      (i % 3) < 1 ? "Fizz " :
      (i % 5) < 1 ? "Buzz " :
      ((i % 3)+(i % 5)) < 1 ? "FizzBuzz " : i
    );
  }
}

AJStacy commented Jul 23, 2017

// My JS version
function fizzbuzz() {
  for (var i = 1; i <= 100; i++) {
    console.log(
      (i % 3) < 1 ? "Fizz " :
      (i % 5) < 1 ? "Buzz " :
      ((i % 3)+(i % 5)) < 1 ? "FizzBuzz " : i
    );
  }
}
@Gabriel1986

This comment has been minimized.

Show comment
Hide comment
@Gabriel1986

Gabriel1986 Jul 31, 2017

Slightly convoluted, but it's easy to add any other random rule (even ones that don't have the default "if a number can be devided by x, do y", just implement functions applies and apply and you're all set)

function FizzBuzzRule(fizzBuzzNumber, fizzBuzzTerm) {
  this.applies = number => number % fizzBuzzNumber == 0;
  this.apply = acc => acc + fizzBuzzTerm;
}


var rules = [
  new FizzBuzzRule(3, "Fizz"), 
  new FizzBuzzRule(5, "Buzz")
];

for(i = 1; i <= 100; i++) {
  var output = rules.reduce((acc, rule) => rule.applies(i) ? rule.apply(acc) : acc, "");
  console.log(output || i)
}

Gabriel1986 commented Jul 31, 2017

Slightly convoluted, but it's easy to add any other random rule (even ones that don't have the default "if a number can be devided by x, do y", just implement functions applies and apply and you're all set)

function FizzBuzzRule(fizzBuzzNumber, fizzBuzzTerm) {
  this.applies = number => number % fizzBuzzNumber == 0;
  this.apply = acc => acc + fizzBuzzTerm;
}


var rules = [
  new FizzBuzzRule(3, "Fizz"), 
  new FizzBuzzRule(5, "Buzz")
];

for(i = 1; i <= 100; i++) {
  var output = rules.reduce((acc, rule) => rule.applies(i) ? rule.apply(acc) : acc, "");
  console.log(output || i)
}
@Zykatious

This comment has been minimized.

Show comment
Hide comment
@Zykatious

Zykatious Jul 31, 2017

let rules = [
    {mult:3, text:"Fizz"},
    {mult:5, text:"Buzz"}
]

for(var i=1; i<=100; i++){
    var output = "";
    rules.forEach(function(rule){
        if(i % rule.mult === 0){
            output+=rule.text;
        }
    })
    console.log(output ? output : i);
}

Zykatious commented Jul 31, 2017

let rules = [
    {mult:3, text:"Fizz"},
    {mult:5, text:"Buzz"}
]

for(var i=1; i<=100; i++){
    var output = "";
    rules.forEach(function(rule){
        if(i % rule.mult === 0){
            output+=rule.text;
        }
    })
    console.log(output ? output : i);
}
@mushishi78

This comment has been minimized.

Show comment
Hide comment
@mushishi78

mushishi78 Aug 1, 2017

Some of the early answers seemed to think that using the Array constructor and map was faster, but were actually faster because they only use console.log once.

So the faster solution is:

var str = "";

for (var i = 1; i <= 100; i++) {
  if (i % 15 === 0) str += "FizzBuzz\n";
  else if (i % 3 === 0) str += "Fizz\n";
  else if (i % 5 === 0) str += "Buzz\n";
  else str += i + "\n";
}

console.log(str);

Here's a jsPerf: https://jsperf.com/fizzbuzz6585679

mushishi78 commented Aug 1, 2017

Some of the early answers seemed to think that using the Array constructor and map was faster, but were actually faster because they only use console.log once.

So the faster solution is:

var str = "";

for (var i = 1; i <= 100; i++) {
  if (i % 15 === 0) str += "FizzBuzz\n";
  else if (i % 3 === 0) str += "Fizz\n";
  else if (i % 5 === 0) str += "Buzz\n";
  else str += i + "\n";
}

console.log(str);

Here's a jsPerf: https://jsperf.com/fizzbuzz6585679

@puppy0cam

This comment has been minimized.

Show comment
Hide comment
@puppy0cam

puppy0cam Aug 1, 2017

a fully configurable version that can keep going until you run out of memory
function playFizzBuzz(config) { var config = config || {max: 100,min: 1,scoring: [false,false,"fizz",false,"buzz"]} config.max = config.max || 100; config.min = config.min || 1; config.scoring = config.scoring || [false,false,"fizz",false,"buzz"] config.next = config.min; var fizzbuzz = function(number) { var score = []; config.scoring.forEach(function(currentValue,pos){ if (currentValue) { if(number/(pos+1) === Math.floor(number/(pos+1))) { score[pos] = currentValue; } else { score[pos] = false; } } else { score[pos] = false; } }); return score; } var items = []; while(config.next < config.max+1) { items[config.next] = fizzbuzz(config.next); config.next += 1; } var completedString = ""; items.forEach(function(currentValue,pos){ var announcer = ""; currentValue.forEach(function(spot){ if(typeof(spot)==="string") { announcer += spot; } }); if(announcer.length===0) { announcer = pos; } completedString += "\r\n"+announcer; }); return completedString; }

puppy0cam commented Aug 1, 2017

a fully configurable version that can keep going until you run out of memory
function playFizzBuzz(config) { var config = config || {max: 100,min: 1,scoring: [false,false,"fizz",false,"buzz"]} config.max = config.max || 100; config.min = config.min || 1; config.scoring = config.scoring || [false,false,"fizz",false,"buzz"] config.next = config.min; var fizzbuzz = function(number) { var score = []; config.scoring.forEach(function(currentValue,pos){ if (currentValue) { if(number/(pos+1) === Math.floor(number/(pos+1))) { score[pos] = currentValue; } else { score[pos] = false; } } else { score[pos] = false; } }); return score; } var items = []; while(config.next < config.max+1) { items[config.next] = fizzbuzz(config.next); config.next += 1; } var completedString = ""; items.forEach(function(currentValue,pos){ var announcer = ""; currentValue.forEach(function(spot){ if(typeof(spot)==="string") { announcer += spot; } }); if(announcer.length===0) { announcer = pos; } completedString += "\r\n"+announcer; }); return completedString; }

@joshyrobot

This comment has been minimized.

Show comment
Hide comment
@joshyrobot

joshyrobot Aug 1, 2017

My solution (which I think is better than quite a few of these in terms of readability and understandability):

const fizzbuzz = (value, multiples) => {                                        
  let words = []                                                                
  for (let multipleStr in multiples) {                                          
    // parseInt because numeric keys are cast to strings                        
    const multiple = parseInt(multipleStr)                                      
                                                                                
    if (value % multiple === 0) words.push(multiples[multiple])                 
  }                                                                             
                                                                                
  const joined = words.join('')                                                 
  return joined || value                                                        
}                                                                               
                                                                                
for (let i = 1; i <= 100; i++) {
  const output = fizzbuzz(i, { 3: 'fizz', 5: 'buzz' })
  console.log(output)
}

joshyrobot commented Aug 1, 2017

My solution (which I think is better than quite a few of these in terms of readability and understandability):

const fizzbuzz = (value, multiples) => {                                        
  let words = []                                                                
  for (let multipleStr in multiples) {                                          
    // parseInt because numeric keys are cast to strings                        
    const multiple = parseInt(multipleStr)                                      
                                                                                
    if (value % multiple === 0) words.push(multiples[multiple])                 
  }                                                                             
                                                                                
  const joined = words.join('')                                                 
  return joined || value                                                        
}                                                                               
                                                                                
for (let i = 1; i <= 100; i++) {
  const output = fizzbuzz(i, { 3: 'fizz', 5: 'buzz' })
  console.log(output)
}
@rooperl

This comment has been minimized.

Show comment
Hide comment
@rooperl

rooperl Aug 1, 2017

[...Array(100).keys()].map(n => ++n).map(n => console.log(`${n % 3 ? '' : 'Fizz'}${n % 5 ? '' : 'Buzz'}` || n));