for (let number = 0; number <= 100; number++ ) {
let output = ""
if (number % 3 == 0) output += "Fizz"
if (number % 5 == 0) output += "buzz"
console.log(output || number)
}
I understand why it finds the modulo for 3 and 5. But why does this also find the modulo for 15? (The question asks to also find the numbers that are divisible by 3 and 5 and print "Fizzbuzz").
I was able to solve the question in a different manner and was offered this as one of the ideal solutions.
Is the += after the output somehow multiplying the other two remainders?