Pass-by-Value vs Pass-by-Reference — The Bug That Taught Me How Variables Travel

I used to think passing a variable into a method meant I was giving the method direct access to it.
Until one day, I tried to update a…