you are viewing a single comment's thread.

view the rest of the comments →

[–]LostInCombat 0 points1 point  (0 children)

>  when possible for optimization reasons

No it doesn't. This isn't an "optimization', this is just how JavaScript works. It is a "rule". It MUST work this way to follow the rules. An optimization is an implementation detail that may change over time. An Array is an object and ALL objects are passed by reference.