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

Ruby

Lindsay Terrell
Lindsay Terrell
9,888 Points

Ruby Foundations/Arrays/Extra Credit

Write a program that prints out the items inside of the array in a sorted order.

My solution:

bouquet = Array.new
bouquet << "tulip"
bouquet << "zinnia"
bouquet << "rose"
puts bouquet.sort!

3 Answers

bouquet = Array.new
bouquet = ["tulip","zinnia","rose"]
puts bouquet.sort!

whats the question ?!

Lindsay Terrell
Lindsay Terrell
9,888 Points

No question. Just wanted to share my results. Often moderators or advanced students will chime in with suggestions on improving the code.