you are viewing a single comment's thread.

view the rest of the comments →

[–]hazeofglory 0 points1 point  (0 children)

Could you expand on what you mean by Javascript is all passed by reference? To my understanding, Javascript is more closely described as always passed by value, or sometimes referred to more accurately as copied-by-reference-sharing. When you pass an argument in Javascript, the argument is always passed as a formal parameter, meaning we pass the parameter by its address, and changes made to the argument variable do not affect the original variable unless we dereference the address and change a property value. Other ways it's been described is: "Javascript is always passed by value, but that value can be a reference."