Converting between strings and symbols- Syntax Question


#1

So I was trying to do this exercise, create a new empty array and fill it with symbols made from strings in an old array.
This is my code:

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

Add your code below!

symbols = []

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

but this doesn't work, it only works if I do this :

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

Add your code below!

symbols = []

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

why is this?


#2

I don't understand, what are those "Add your code below!" Please use the code snippet for better readability.