goldsmith/plugins/minify/testdata/source/fizzbuzz.js

17 lines
341 B
JavaScript
Raw Normal View History

2024-02-17 06:35:49 +00:00
function fizzbuzz(n) {
for (var i = 1; i <= n; 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);
}
}
}