Pass by Value or by Reference and Impure or pure functions
Pass by value and pass by reference are about function calls (method calls in case of OOP).

Pass by value means that variable is copied in function and any changes to variable are visible only within scope, where it was changed, if you pass reference then any modification to variable in the function is preserved after function call.

int x = 5;
void PassByValue(y) {
   y = 6;
  // some code
}
void PassByReference(&amp;y) {
  y = 6;
  // some code here
}
PassByValue(x);
// here x is still 5
PassByReference(ix);
// here x is equal 6


Let O be object {x: 8}, that it's private variable x and setter method O.set(y) with code this.x = y;
If you pass by value or pass by reference, it doesn't matter, the state of object is changed.

Impure function has side effects outside of it's scope, so:  

void Impure() {
  x = 6;  
}  


It does not get any parameters, but changes variable in outer scope, this is side effect.

Another property of impure function is that they do not solely rely on input parameters, one canonical example is:  

int rand(int x) {
  return rand() * x;
}


Pure function returns the same result at every call, so for example math functions obey this property.
Any observable side effect: I/O operation, mutation, outer scope modification, network trafic, and so on, are impure.