JavaScript JavaScript Loops, Arrays and Objects Simplify Repetitive Tasks with Loops Create a for Loop

Dinasha Rollins
Dinasha Rollins
1,464 Points

what am I missing

i have been stuck on this for 15 minutes and is still confused on what is missing

script.js
var html = '';

for ( var i = 4; 4 <= 156; i +=4 ) {
   html += '<div>' + i + '</div>';
}
console.log(html);

1 Answer

Steven Parker
Steven Parker
174,177 Points

Here's a few hints:

  • when logging to the console, you won't need any HTML tags
  • the challenge is expecting you to log each value individually (from inside the loop)
  • be sure to log all values in the range (not just every 4th value)