Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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

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
229,657 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)