How does it work when there is no argument in the function of sort()? [duplicate]

function shuffle(array) {
  **array.sort(() => Math.random() - 0.5);**
}

let arr = [1, 2, 3];
shuffle(arr);
alert(arr);

The function of sort() is an arrow function with no arguments, so I wonder how it works.