Rb119 ta philip

· nulo's blog


=begin AGENDA - ASSESSMENT PREP

Array mutation discussion - https://launchschool.com/posts/6b1cde9b

identity of elements

1a = 'red'
2b = 'red'
3a.equal?(b) # false

the salient parts of an array are the pointers and their order

a shallow copy (in case of a nested array) copies the array itself while the objects referenced by the array's pointers are shared between the original and the copied object

freezing an object means making the object immutable this can be done using the #freeze method

Object#dup and Kernel#clone both make shallow copies of their calling objects the difference is