Have a question about this lesson: lesson
" * When we passed spaceship
into that function, obj
became a reference to the memory location of the spaceship
object, but not to the spaceship
variable. This is because the obj
parameter of the tryReassignment()
function is a variable in its own right. The body of tryReassignment()
has no knowledge of the spaceship
variable at all!
- When we did the reassignment in the body of
tryReassignment()
, theobj
variable came to refer to the memory location of the object{'identified' : false, 'transport type' : 'flying'}
, while thespaceship
variable was completely unchanged from its earlier value.’"
This is very difficult to understand. What the lesson is trying to say in the first part, is that not the object spaceship is thrown into the function, but a temporary new copy of the object as the variable “obj” ?