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

Alphonse Cuccurullo
Alphonse Cuccurullo
2,513 Points

Help me please?

strings = ["HTML", "CSS", "JavaScript", "Python", "Ruby"]

symbols = []

strings.each {|s| s.to_sym.push(symbols)}

The goal is to convert the strings in the string array into symbols and add them to the symbols array. Everytime i try this its tells me that the html symbol isnt factoring. Here is the link.

https://www.codecademy.com/courses/ruby-beginner-en-Qn7Qw/1/4?curriculum_id=5059f8619189a5000201fbcb#

1 Answer

Clayton Perszyk
MOD
Clayton Perszyk
Treehouse Moderator 48,107 Points

HI Alphonse,

You want to call push on the symbols array and pass it the string converted to a symbol; the way you have it, push is being called on the string, converted to a symbol.

strings.each {|s| symbols.push(s.to_sym)}

Best,

Clayton