-2

// program to display text 10 times
const n = 10;

// looping from i = 1 to 10
for (let i = 1; i <= n; i++) {
    console.log(`I love JavaScript.`);
}

I try to replace console.log with document.getElementById("demo").innerHTML = "I love JavaScript", but can't replicate the example.

M0nst3R
  • 5,186
  • 1
  • 23
  • 36

1 Answers1

0

You have to use += "I love JavaScript."

Slenderman00
  • 107
  • 7