Undefined local variable or method `s' for #<Context:0xf631dc>


#1



I make an array with some objects. than make another array, but without any objects. and my mission was to set my objects from string to symbol, and than put them to the empty array. i used "to_sym" method, but something goes wrong. help me with my problem, please!

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



Replace this line with your code. 
strings = ["HTML", "CSS", "JavaScript", "Python", "Ruby"]
symbols = []
strings.each do |s| s.to_sym
end
symbols.push(s)


#2

Hi this line

symbols.push(s)

should be insid the

strings.each do |s| 
    s.to_sym
    #symbols.push(s)
end

then change the lines insid the each do like that

symbols.push( s.to_sym)

#3

yeeeehh, thank u. it realy works!


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.