How do the arguments a and b iterate through the array of this example below?

```
var array = [1, 12, 21, 2];
array.sort(function(a, b) {
return a - b;
});
```

I understand that is (a - b) is positive it will move the number to the right, but then do a and b move over to the next numbers or how does that work? I’ve watch about half a dozen videos and no one goes to explain how this works

So for example, if we run this I’m assuming it goes like this a = 1, b = 12, 1 - 12 = -11 so 1 stays in place as it is a negative number.

Then what? Does a = 12 and then b = 21 which would then still be negative. So ok, this is working so far… this is where I get hung up though. Again, I’m assuming a and b will move over one soooo a = 21 and b = 2 which gives us a positive number.

This will move 2 to the left so now we have 1, 12, 2, 21, and this is where I’m lost. So what is the value of a and be now that we have come to the end of this? Does it start from the beginning? Are we back to a = 1 and b = 12 then shifting over each time until we’ve reach then end? Please help