=begin AGENDA - ASSESSMENT PREP
- Introductions
- Overview of Assessment format:
=> Written Assessment
- 1hr 45min time limit
- Around 11 questions
- Use Markdown
- Clear, detailed, and precise answers
- Time management => Interview Assessment
- 1 hour / 2 problems
- Focus: structured problem solving, Ruby fluency, and communication ability
- No documentation
- Be sure to complete PEDA before moving on to C
- Test code early and often
- Communicate! (and not just what you are typing)
- Study Tips for Assessments:
=> Practice problems
=> Study with other students
- Try Gather.town (via #the-spot on Slack)
- Questions?
- Practice
- Wrap up & feedback form =end
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
- when the pointers are reassigned the array is mutated
- when the elements in an array are mutated the array is not mutated since the pointers remain the same
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
clone
preserves the frozen statedup
always creates an unfrozen copy of the calling object