I have a multi-dimensional array in javascript defined as :-
myArray[0][0] = Some IMage;
myArray[0][1] = Some price;
myArray[0][2] = Some name;
myArray[0][3] = Some values;
myArray[0][4] = Some otherValues;
myArray[1][0] = Some IMage;
myArray[1][1] = Some price;
myArray[1][2] = Some name;
myArray[1][3] = Some values;
myArray[1][4] = Some otherValues;
Now my job is to sort them according to the price . How can this be done ?
Per my comment above, you should probably use objects instead of multi-dimensional arrays. Here’s an example (imagine your additional attributes like
nameandIMageincluded, which I didn’t include for the sake of less typing)