FizzBuzz

Benchmark created by georgecalm on


Setup

var i, out = [];

Test runner

Ready to run.

Testing in
TestOps/sec
FizzBuzz Every Time
for (i = 1; i <= 100; i++) {
  out[out.length] = ((0 === i % 15) ? 'FizzBuzz' :
                     (0 === i %  3) ? 'Fizz' :
                     (0 === i %  5) ? 'Buzz' : i);
}
ready
FizzBuzz After Fizz
for (i = 1; i <= 100; i++) {
  out[out.length] = (0 === i % 3) ?
                   ((0 === i % 5) ? 'FizzBuzz' : 'Buzz') :
                   ((0 === i % 5) ? 'Fizz' : i);
}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.

  • Revision 1: published by georgecalm on