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 trialdan cornwell
6,877 Pointswhat is going on. can you help me with this hash
i just do not understand what they are asking me
grocery_item = { "item" => "Bread", "quantity" => 1, "brand" => "Treehouse Bread Company" }
calories = { "calories" => 100 }
final_item
final_item.merge({"calories0})
2 Answers
Andrew Stelmach
12,583 PointsThey asked you to create a variable called final_item
that is assigned to a hash consisting of the grocery_item
hash merged with the calories hash.
Solution:
- google "ruby hash"
- Click on the top search result,
- Press CTRL + F or CMD + F (for Mac) and search for "merge". Find the merge method documentation.
- Use that documentation to figure out how to complete this challenge.
Post back here with your findings. If you still can't do it, explain what you don't understand and someone will help you. Hopefully no-one will just give you the answer straight away.
Cindy Lea
Courses Plus Student 6,497 PointsOK. Just a hint. Your last statement is wrong. Your merge is in the wrong place.