Skip to content

Instantly share code, notes, and snippets.

@Torxed
Last active July 31, 2017 19:31
Show Gist options
  • Save Torxed/f6656e267085c884853d0af0ca615696 to your computer and use it in GitHub Desktop.
Save Torxed/f6656e267085c884853d0af0ca615696 to your computer and use it in GitHub Desktop.
<html>
<head>
<script>
for (let i=1; i <= 100; i++) {
let map = {3: "Fizz", 5: "Buzz"};
let output = ""
for (let key in map) {
output += i%key==0 ? map[key] : "";
}
console.log(output.length > 0 ? output : i);
}
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment