- Ruby object references vs collection references
- numbers = ["one", "two", "three"]
- numbers[2] = "four"
- numbers[2].replace("four")
- numbers.replace [1,2,3]
- TypeError: can't modify frozen array
- ree-1.8.7> numbers[2].object_id
- => 2149301040
- ree-1.8.7> numbers[2].replace "four"
- => "four"
- ree-1.8.7> numbers[2].object_id
- => 2149301040