Passing a function as a callback. Just like a regular object, you can pass a function object to another function (actually you've already seen this in action with the negate function example). In the next example, two different functions, add and multiply, are passed as a parameter to the function action.Of course, only a reference to the function is passed.
So, when you call a function and pass an object to it, you're actually passing a copy of a reference to that object. The copied reference still points to the same object in memory, but if you change where that reference points to in the callee, it doesn't affect the calling function because they are distinct references.
If you haven’t already, I recommend writing very simple examples - separately - of one of the above. Run it in Chrome, turn on the developer tools window, then single-step your way through it. Create some basic JS to work through one of those poin.
Although Java is strictly pass by value, the precise effect differs between whether a primitive type or a reference type is passed. When we pass a primitive type to a method, it is passed by value. But when we pass an object to a method, the situation changes dramatically, because objects are passed by what is effectively call-by-reference.