Skip to content

Instantly share code, notes, and snippets.

@rupertbg
Last active February 14, 2019 02:52
Show Gist options
  • Save rupertbg/d13f73013357ef326ca3e0cf14ca064d to your computer and use it in GitHub Desktop.
Save rupertbg/d13f73013357ef326ca3e0cf14ca064d to your computer and use it in GitHub Desktop.
Simple JS FizzBuzz Solution
for (var i = 1; i <= 30; i++) {
var output = "";
!(i % 3) ? output += 'fizz' : null;
!(i % 5) ? output += 'buzz' : null;
output ? console.log(i, output) : null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment