Confused about what the colon does in (&:to_s)


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

strings_array = numbers_array.map(&:to_s)

I get it that I am converting each of the integers of the array to strings, but I got a bit confused because I thought that when I put a colon it means its a symbol, can someone explain to me why there is a ":" there please.
Thank You


#2

Yes, it's a symbol, the symbol :to_s, which refers to the method to_s.

The & operator converts anything after it to a proc (as you will see in the course on procs). A proc is basically a piece of code stored in an object.