I've made the following swap function:
function swap(a,b)
{
var c=b;
b=a;
a=c;
}
It is supposed to swap 2 numbers. I have the follwing code:
var x=5;
var y=10;
swap(x,y);
The problem is that when I output the vaues of these variables after swap I still get 5 for x and 10 for y. Any ideas?