6. What is a symbol?


#1

Hello everyone!
There's no coding in this lesson besides reading and understanding what is provided. My question is: How and where does Ruby generate these numbers and how are they relevant to the code?

puts "string".object_id
puts "string".object_id

puts :symbol.object_id
puts :symbol.object_id

Console:
4572300
4572100
317608
317608
nil

Thanks!


#2

I think that object_id is well explained in this article. I hope that will help you to understand it.