Pass by value
Last updated
Last updated
Any change that you make to the arguments inside the function DOES NOT affect the passing variables outside of the function.
In other words, the changes made to the arguments are not reflected outside of the function.
Resource:
When you pass an object to a function, you are passing the reference of that object, not the actual object.
Therefore, the function can modify the properties of the object via its reference.
BUT the function CANNOT change the reference variable to reference another object.
Resource: