M
I leave you an example I don't know if it's the functionality you're looking for, what I did was pass the array. Data to a new array And that's what you do. draw, research and I did not find how to ignore directly with some property or function for the Sort, apart from changing your function drawthe comparison in the IF you can change 1 for a variable or whatever you wantvar datos = [
{"asd1":"prueba11", "asd3":"prueba13", "asd2":"prueba12","asd4":"prueba14", "asd5":"prueba15"},
{"asd1":"prueba21", "asd2":"prueba22","asd5":"prueba25" ,"asd3":"prueba23", "asd4":"prueba24"},
{"asd1":"prueba11", "asd2":"prueba42", "asd3":"prueba43", "asd4":"prueba44", "asd5":"prueba45"},
{"asd1":"prueba31", "asd2":"prueba32", "asd3":"prueba33", "asd4":"prueba34", "asd5":"prueba35"},
{"asd1":"prueba41", "asd2":"prueba42", "asd3":"prueba43", "asd4":"prueba44", "asd5":"prueba45"},
{"asd1":"prueba51", "asd2":"prueba52", "asd3":"prueba53", "asd4":"prueba54", "asd5":"prueba55"}
];
const datos2 = [];
console.log(datos);
console.log("---------------------------------");
datos.forEach(function(x, i){
console.log(i)
if(i != 1){
datos2.push(x);
}
});
datos2.sort(function (a, b) {
//console.log("variables: " + a.asd1 +" - "+ b.asd1)
if (a.name > b.name) {
return 1;
}
if (a.name < b.name) {
return -1;
}
return 0;
});
console.log("----------------Array sin el indice 1-----------------");
console.log(datos2);