This is from a Codecademy lesson and I am aware people have asked about it on here, but I want to see what is wrong with my solution in particular. Here is what they start you out with:
strings = ["HTML", "CSS", "JavaScript", "Python", "Ruby"]
# Add your code below!
Here are the instructions:
We have an array of strings we'd like to later use as hash keys, but we'd rather they be symbols.
Create a new variable, symbols, and store an empty array in it. Use .each to iterate over the strings array. For each s in strings, use .to_sym to convert s to a symbol and use .push to add that new symbol to symbols.
I apologize as the formatting did not copy over prefectly, but you get the idea.
Here is my solution:
strings = ["HTML", "CSS", "JavaScript", "Python", "Ruby"]
# Add your code below!
symbols = []
strings.each do |s|
s.to_sym
symbols.push(s)
end
Upon submitting this, I get the error that I did not correctly convert the string to a symbol.