I have a piece of code here which I am finding difficult in understanding the sorting mechanism. I am new to programming, can anyone help me in understanding
function sortNumber(a, b) {
return a - b;
}
var numArray = [140000, 104, 99];
numArray.sort(sortNumber);
console.log(numArray);