Create a gist now

Instantly share code, notes, and snippets.

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);
}
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++, msg=""){
    if (!(i%3)) msg+="Fizz"; 
    if (!(i%5)) msg+="Buzz"; 
    console.log(msg || 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 commented Aug 8, 2013

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

rhka commented Jul 27, 2014

Excellent guys!

really smallest mobz :)

// 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"));

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')
);
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 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));
(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);

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 commented Mar 9, 2015

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

dotch commented Mar 14, 2015

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

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 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)

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 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);
}
(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 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 */

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)

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)

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

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 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 commented Jul 5, 2015 edited

  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) });

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 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 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

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 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 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');    
 };

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");

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);

CaRDiaK commented 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); 
  • "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

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);
}

(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);
        }
    };
})();
for(var i=1; i<=15; i++) {
  console.log(i%3 ? i%5 ? i : 'buzz' : i%5 ? 'fizz' : 'fizzbuzz');
}

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 );
}

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);
}

ES7 array comprehension:

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

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);
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 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);
}
};

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 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);
};

};

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 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);

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;
};

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); } }

jdissan 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);
});

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 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 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;
    }
}

Short?

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

peteczz 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);
};

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);
}

ES6

[...Array(100).keys()].map(i => { 
  let f = !(i % 3), b = !(i % 5); 
  console.log(f ? b ? "FizzBuzz" : "Fizz" : b ? "Buzz" : i); 
})
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 commented Jun 27, 2016 edited

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 commented Jul 11, 2016 edited

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 commented Jul 16, 2016

// open browser console on this page and copy paste
eval(document.getElementById('gistcomment-882551').getElementsByTagName('code')[0].innerText);
// Kinda readable?
for (var i = 1; i <= 100; i++) {
  console.log(((i%3 ? "" : "Fizz") + (i%5 ? "" : "Buzz")) || i);
}

ahmetilgin commented Jul 22, 2016 edited

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 commented Jul 25, 2016 edited

'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 commented Aug 1, 2016 edited

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

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

SweetLouHD commented Aug 3, 2016 edited

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 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 commented Sep 12, 2016 edited

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

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

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)); }

funador commented Oct 7, 2016 edited

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))

mllanes commented Oct 8, 2016 edited

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 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 commented Oct 19, 2016 edited

@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")

lostride commented Oct 23, 2016 edited

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 commented Nov 4, 2016

That switch statement by kaelig was delicious.

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 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?

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);}
};

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 commented Dec 17, 2016 edited

// 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 commented Dec 22, 2016 edited

// ES6 functional solution

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

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 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);
}

    }

}

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 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));
});

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 commented Jan 27, 2017 edited

@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 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 commented Jan 29, 2017 edited

Posting to be considered for the longest working solution.

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

mrmisterman commented Feb 2, 2017 edited

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 commented Feb 5, 2017 edited

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 commented Feb 10, 2017 edited

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 commented Feb 23, 2017 edited

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++; }

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

Amuktha commented Mar 4, 2017 edited

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 commented Mar 11, 2017 edited

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 commented Mar 24, 2017 edited

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)

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 commented Mar 31, 2017 edited

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

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 commented Apr 7, 2017 edited

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

sbr464 commented Apr 21, 2017 edited

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

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);
}
}`

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);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment