79321073

Date: 2025-01-01 02:31:36
Score: 0.5
Natty:
Report link

what you have to do is make something like my "value" and use that to console.log() and then call that instead of i

const content = document.querySelector(".content")
let value = ""
let displayHTML = ""
let maxValue = prompt("number to fizzbuzz to")
if (maxValue > 2000){
   maxValue = 1000
}
for (let i = 1; i <= maxValue; i++) {
   if (i % 3 === 0 && i % 5 === 0) {
      value = 'fizzbuzz'
   } else if (i % 3 === 0) {
      value =  'fizz'
   } else if (i % 5 === 0) {
      value = "buzz"
   } else {
      value = '' + i
   }
   displayHTML += "<p>" +`&nbsp;&nbsp;${value}, ` + "</p>";
   content.innerHTML = displayHTML
}
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Starts with a question (0.5): what you have to
  • Low reputation (1):
Posted by: Andrew Borlin