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 Tracking Multiple Items with Arrays Using Array Methods

Anett Soos
Anett Soos
1,947 Points

I think my code is good but computer says no

var months = ['January','February','March','April','May','June','July','August','September','October','November','December']; for (var i=0; i<months.length; i+=1){

console.log(months[i] + ", ");

}

Jesus Mendoza
Jesus Mendoza
23,289 Points

Hey Anett, in this challenge you have to use te method .join() instead a for loop!

2 Answers

Konrad Pilch
Konrad Pilch
2,435 Points

You need wrapp it liek this

```javascript

var = apple

```

it will display

var = apple

Try it yourself.

Anett Soos
Anett Soos
1,947 Points

i<months.length; i+=1){

//weird...every time I post my code into this discussion board it is missing the code line above