swap (a, b) {
var temp = a;
a = b;
b = temp;
}
Sample function execution:
value = 2, List = {1,3,5,7,9};
swap(value, List[0])
swap(List[0], List[1])
swap(value, List[value])
If the parameters to swap() use the modes
swap (in out a, in b),
List is unchanged after the three calls to swap.