Im not understanding the explanation in this lesson. What spaceship variable? There is a spaceship object but I just dont really understand the explanation. Help please, the bit im confused about specifically says: " * 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!"
I found this on stack overflow which for me i think has helped a bit with the understanding. Was looking through a good few answers Is JavaScript a pass-by-reference or pass-by-value language? - Stack Overflow