Pass an object to a function and change it inside the function. Hey, surprise, it’s changed at the call site, too. Okay, so we’re passing by reference. Now, do the same, but assign something else to it. This does not change the object at the call site. What the…?!
Did a little research, found out that they call this “pass by value of reference”. Now, I kind of understand the logic behind it, but… Hey, either be consistent or allow me to control how I want to pass things myself.
Oh well, make an explicit copy then. But hey, did you know that there’s no built-in way to create a deep copy of an array?
Am I being a stupid tourist or is JS just weird?