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

what am I missing

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

var html = '';

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

1 Answer

Steven Parker
Steven Parker
201,315 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)