Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby Ruby Collections Ruby Arrays Accessing Items in Arrays

Robert Soule
Robert Soule
9,554 Points

Wording in question is off. It's showing firstitem instead of first_item and grocerylist instead of grocery_list

In challenge task 1 of 3,

Create a variable called "firstitem" that contains the first item from the "grocerylist" array (index 0).

It passed when using "first_item" and "grocery_list". Just FYI

5 Answers

Maciej Czuchnowski
Maciej Czuchnowski
36,440 Points

The staff was notified, they will probably take care of this on Tuesday (since Treehouse has 3-day weekends ;) ). The underscores get interpreted as switching between italic and normal font.

Return is rarely used in Ruby since the value of the last operation you performed is always returned by default, so return is redundant.

ellie adam
ellie adam
26,376 Points

first_item = grocery_list[0]

Maciej Czuchnowski
Maciej Czuchnowski
36,440 Points

This question was asked a long, long time ago when the content of the challenge was different. Now it's correct.

Yes I noticed many things like that in the ruby course get overlooked. Instead of "puts" for example I wrote "return" and it accepted it alright which was odd, since on the course I was in, the instructor had never use return yet. In the end of the quizzes it asks for feedback. You can also note bugs there if you haven't tried it already, it might help get those fixed faster, maybe.

Robert Soule
Robert Soule
9,554 Points

Alright good to know, also further on in the Hash segment, it repeats add key "name" value "milk". But it really wants you to add the key "quantity" and value 1.

Maciej Czuchnowski
Maciej Czuchnowski
36,440 Points

Yeah, I told them that as well ;). If it's not corrected by Friday, I will contact them again.

Kenny Moreno
Kenny Moreno
3,406 Points

Most of the Ruby challenges have errors