Depending on the value, different things.
Values like numbers or strings are called primitive values because these are kinds of data that just represent one value. An example of a primitive value might be the string ‘Hey’. That same string has a specific location where it lives that your computer remembers. When you pass a primitive value into a function, a copy of that value gets created. This is called passing by value.
When you pass your object into a function, that parameter inside the function points to the same place in memory that the original object does. This is called passing by reference.
This just means: when you pass an object into your function, and you change that object inside the function, it’s going to change the object in other places too.
These are the differences between passing by value and passing by function.