11/21 Symbols Meet Procs


I am totally lost on this lesson. It talks about converting symbols to procs but I don't see procs anywhere. Furthermore, for me, the lesson appears to be taking each integer in a numbers array, and then converting it into a string. Nowhere do I see procs, so how do Symbols meet procs? Am I the only one missing something?

Please help. Please use simple example if possible. Thanks in advance!


Replace this line with your code.


Maybe reading some article's written by programmers in stackoverflow.com
google search
== discussions / opinions ==
ruby symbols to procs site:stackoverflow.com
for instance


Try this code:

numbers_array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

puts strings_array = numbers_array.collect(&:to_s)


I get the .collect bit but (&:to_s) what is the significance of the s?


(&:to_s) turns integers (or numbers) into strings

(&:to_i) does the opposite; it turns strings into integers (or numbers)


Good morning
Allow me to ask a delayed (2 and 1/2 years later!) question.
Do you mean that (&:to_i) can replace iteration (i.e. with .each)

Thank you