Answer the question
In order to leave comments, you need to log in
How to sort an array of arrays?
I have an array of elements that I received from an object, they are listed below, I need to sort the array in ascending order. Tell me which way to move, what to use
let result;
let firstFiveTickets;
if (tickets !== undefined) {
result = Object.keys(tickets).map(value => Object.values(tickets[value]));
firstFiveTickets = result.slice(0, 5)
}
// tickets - это объект
[Aray(3), Array(3), Array(3), Array(3), Array(3)]
0: (3) [34225, "EK", Array(2)]
1: (3) [74322, "EK", Array(2)]
2: (3) [53769, "MH", Array(2)]
3: (3) [53281, "SU", Array(2)]
4: (3) [30178, "EK", Array(2)]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question