Answer the question
In order to leave comments, you need to log in
How to convert the string value of one array to a character and transfer it to another array?
Hello. I'm taking a course at codeacademy. I study Hashes and symbols. Can you please tell me why my code says "Oops, try again. It looks like you didn't add each symbolized string to the symbols array."?
strings = ["HTML", "CSS", "JavaScript", "Python", "Ruby"]
# Add your code below!
symbols = []
strings.each {|s|
s.to_sym
symbols.push(s)
}
symbols.push(s.to_sym)
Answer the question
In order to leave comments, you need to log in
Because it is to_sym
not destructive, it returns a character, but does not change the initial value of the variable.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question