Skip to content

Instantly share code, notes, and snippets.

@SeeThruHead
Last active August 29, 2015 14:13
Show Gist options
  • Save SeeThruHead/76f7833b6242e1cf8b6d to your computer and use it in GitHub Desktop.
Save SeeThruHead/76f7833b6242e1cf8b6d to your computer and use it in GitHub Desktop.
console.log(
Array.apply(null, {length: 100}).map(function(val, index) {
return (++index%3?'':'Fizz')+(index%5?'':'Buzz')||index;
}).join('\n')
);
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')
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment