Learn JavaScript Syntax - OBJECTS Pass By Reference

Hey im a bit confused by the wording and explanation in the above lesson; specifically the following:

  • 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(), the obj variable came to refer to the memory location of the object {'identified' : false, 'transport type' : 'flying'}, while the spaceship variable was completely unchanged from its earlier value.

Im not understanding the difference between the spaceship variable and the spaceship object - I thought they were one and the same, just an object has more than one property.

I dont understand why you cant reassign an object through a function but you can change its properties through one even though the parameters are the same reference.

Any clarification or an explanation in different wording would be hugely appreciated!

I think i might be understanding it -

is it similar to why const objects can change their properties but not be reassigned? - changing the object as a whole (reassigning) would change its reference, and therefore would mean the reference given to a function to reassign it would then no longer be valid?