I am trying to sort large Array list of Arrays using below code
function _stInd(arr, ind){
return arr.sort(function(a, b) {
var _1 = a[ind];
var _2 = b[ind];
return (_1 < _2) ? -1 : (_1 > _2) ? 1 : 0;
});
}
Please look at this bin for more info http://jsbin.com/UqEPOfa/3/edit
The code is working fine and it is able to sort also. But the problem is it is taking too much if I am trying to sort more than 1 million list of arrays based on one index.
Please suggest me to improve this code