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

Need help

Having a hard time figuring out how to complete this. Am I'm missing anything?

script.js
for ( var counter = 4; counter < 156; counter +=1) {
  console.log (counter);

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! Yes, you are missing two things. You are missing a closed curly brace and an equals sign. Because it wants 156 logged out as well you either need <= 156 or < 157. I'll leave the closed curly brace placement up to you.

Hope this helps! :sparkles:

Ben Reynolds
Ben Reynolds
35,170 Points
  1. Your loop stops when counter is less than 156, so 155 is the last number it logs. To include 156 use less than or equal to
  2. Missing closing brace at the end