var gimme = function (inputArray) {
var order = inputArray.slice().sort(function(a,b) { return a-b;});
return inputArray.indexOf(order[1]);
};
This is a function to find the index number of the middle number in a sequence, when given a triplet of numbers. However I don't understand the section:
(function(a,b) { return a-b;});
Could someone explain the purpose of this part? I would be very grateful. Thanks!